Limiting the values of a column
4 次查看(过去 30 天)
显示 更早的评论
I have a column 'y' contains different values. I want to only take the values between -10 and 10 in an other column.
How can I do that?
2 个评论
采纳的回答
the cyclist
2020-9-14
If you mean that y is a column vector, then
y_new = y((y>=-10) & (y<=10))
will give you a new column vector with only the values between (and including) -10 and 10.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!