Extracting parts of a matrix based on the properties of the elements in the first column
I have some data consisting of 2 columns and thousands of rows. The first column is time data. How do I extract the part of the data wh开发者_JAVA技巧ere the values in the first column are between say, 100 and 300. I can do that for a single vector x=t(find(t>=100&t<=300)), but I also want the corresponding values from the second column.
This is in Matlab, by the way.
I hope that's clear. Any ideas?
BvV
Use this
x=t(t(:,1)>=100&t(:,1)<=300,:);
精彩评论