Column selection in Matlab
51,878
Yes, it is possible. If your matrix is named A
then A(:, [3,7,12,89])
will retrieve the columns numbered 3, 7, 12, and 89.
Related videos on Youtube
Author by
Ramala
Updated on July 09, 2022Comments
-
Ramala over 1 year
Is it possible to select only particular columns of a matrix? E.g. I have a 10x100 shaped matrix and I only would like to get these 4 columns: 231, 82, 12, 493.
-
gnovice almost 13 yearsA reference I suggest looking at: Matrix indexing in MATLAB.
-
mdhansen about 5 yearsSince the link above appears to be broken, here's an updated one: mathworks.com/company/newsletters/articles/…
-