If you have an existing 2D matrix, you can assign an ... I use Octave, but Matlab has the same syntax.
stackoverflow.com