What does y(:,1) mean? (Matlab)

From MurrayWiki
Jump to: navigation, search

If you define a bidimensional array y, and you want to access all its elements on the first column:

y(:,1)

will do it.

If you want to access to all the elements of the fift row:

y(5,:)

is the syntax you have to use. The colon means: take all the elements along the specified dimension. --Franco 18:36, 29 September 2006 (PDT)

Personal tools
Courses