5.9) Linear Indices
An alternative way of accessing elements of a matrix is using linear indices rather than dimensional subscripts. For example:
[matlab]
>> d=rand(4,4)
>> d(2,3) % using subscripts
>> d(10) % using a linear index
[/matlab]
The linear index counts down the rows (first dimension) of the first column, then moves gradually along the columns (second dimension), then along subsequent dimensions (if any).