get only one field from 251x150 double in matlab

Suppose you have a 251x150 double matrix A and you want to extract the 100th column and save it to a new variable B.

You can do this by indexing the matrix:

main.m
B = A(:,100);
14 chars
2 lines

Here, : denotes all the rows, and 100 denotes the 100th column.

Now, B contains a 251x1 column vector with the values of the 100th column of A.

gistlibby LogSnag