How do I get specific rows from a matrices where a<= x<= b
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a matrix "data1" of 3 colums and 1253 rows. Let say the colums are (x,y,z), I want to get a matrix when 75 <= y <= 150 and x <= 10.
y=data1(:,2);
l=data1(75<y<150,1:3);
This doesn't work.
0 个评论
采纳的回答
JESUS DAVID ARIZA ROYETH
2020-7-7
编辑:JESUS DAVID ARIZA ROYETH
2020-7-7
newmatrix=data1(and(and(data1(:,1)<=10,data1(:,2)<=150),data1(:,2)>=75),:)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!