Mixing subscripts with linear indices
Generally speaking, I have found that it has always been possible to mix subscript and linear array indexing with any n-dimensional array, as long as it is in the form,
A(subscript_1,subscript_2,…,subscript_n, linear_index).
For example, given,
A = reshape((1:24)*3, [4, 3, 2]);
all of the following are valid ways of indexing the final element in A,
A(4,3,2)
A(4,6)
A(24)
However, I haven’t been able to find documentation of this, except of course for the trivial case where n=0. Is it officially supported behavior?Generally speaking, I have found that it has always been possible to mix subscript and linear array indexing with any n-dimensional array, as long as it is in the form,
A(subscript_1,subscript_2,…,subscript_n, linear_index).
For example, given,
A = reshape((1:24)*3, [4, 3, 2]);
all of the following are valid ways of indexing the final element in A,
A(4,3,2)
A(4,6)
A(24)
However, I haven’t been able to find documentation of this, except of course for the trivial case where n=0. Is it officially supported behavior? Generally speaking, I have found that it has always been possible to mix subscript and linear array indexing with any n-dimensional array, as long as it is in the form,
A(subscript_1,subscript_2,…,subscript_n, linear_index).
For example, given,
A = reshape((1:24)*3, [4, 3, 2]);
all of the following are valid ways of indexing the final element in A,
A(4,3,2)
A(4,6)
A(24)
However, I haven’t been able to find documentation of this, except of course for the trivial case where n=0. Is it officially supported behavior? indexing, linear, subscripts, undocumented MATLAB Answers — New Questions









