What command will erase all but the first three columns of a matrix in MATLAB? -
I'm essentially trying to get the matrix, a
, and change it into matrix I have the values in the first three columns of a
I just want to sort out a
in my first three columns.
newMatrix = oldMatrix (:, 1: 3)
It says, "I have a matrix called the old matrix. I want to store a subset of that matrix in a new matrix" and the brackets say what you want. The first colon represents "all the rows" and is a symbol of 1: 3 "column 1 to 3".
Comments
Post a Comment