开发者

Extracting parts of a matrix based on the properties of the elements in the first column

开发者 https://www.devze.com 2023-04-01 16:28 出处:网络
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

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,:);
0

精彩评论

暂无评论...
验证码 换一张
取 消