To create a column vector containing the values in the first column of matrix a
in Matlab, you can use the colon operator :
to select all rows in the first column of a
. Here's the code:
main.m12 chars2 lines
The :
specifies that we want to select all rows in the first column of a
, and the 1
specifies that we want to select the first column. By using the colon operator in this way, we create a new vector t
that contains all the values in the first column of a
.
gistlibby LogSnag