The following example appears in the MATLAB tutorial:
X = [16 2 13;
5 11 8;
9 7 12;
4 14 1]
Using a single subscript deletes a single element, or sequence of elements, and reshapes the remaining elements into a row vector. So:
X(2:2:10) = []
results in:
X = [16 9 2 7 13 12 1]
Mysteriously, the entire 2nd row and the first two elements in the 4th row have been deleted, but I can't see the correspondence between the position of the deleted elements and the index vector 2:2:10
. Can someone please explain?