Ramala
Ramala

Reputation: 285

Column selection in Matlab

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.

Upvotes: 17

Views: 54621

Answers (1)

jmbr
jmbr

Reputation: 3348

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.

Upvotes: 39

Related Questions