denno
April 4th, 2005, 04:14 PM
Given the matrix [x x 1; x x 1; x x 2; x x 2; x x 3; x x 3]
How can I reduce the matrix to only contain those rows with 1 in the third column, so I have the resulting matrix [x x 1; x x 1]?
I know that I can do this using a loop, but given that MatLab is intended for matricies, I'm thinking that there is a much easier (and faster) method of accomplishing this. Loops take a while in MatLab and I'm generally dealing with a lot of data.
I'm also wondering if there's a way to only plot this subset using the original matrix as an input. This isn't necessary if I can generate the subset, but it would be nice to know.
Anyway, thanks to anyone who can provide any help.
How can I reduce the matrix to only contain those rows with 1 in the third column, so I have the resulting matrix [x x 1; x x 1]?
I know that I can do this using a loop, but given that MatLab is intended for matricies, I'm thinking that there is a much easier (and faster) method of accomplishing this. Loops take a while in MatLab and I'm generally dealing with a lot of data.
I'm also wondering if there's a way to only plot this subset using the original matrix as an input. This isn't necessary if I can generate the subset, but it would be nice to know.
Anyway, thanks to anyone who can provide any help.