Restricting a vector size
2 ビュー (過去 30 日間)
古いコメントを表示
Hi! I have a vector. I want to select values above a certain value and below a certain value eg: a=[1 2 3 4 5 6 7 8 9 10] I want to select all values between 2 and 6. How can I do that?
Thanks
0 件のコメント
採用された回答
その他の回答 (1 件)
Steven Lord
2017 年 8 月 30 日
Use logical indexing as described in the documentation, this post from Steve's blog or this post from Loren's blog. You want elements that satisfy the logical condition (greater than or equal to 2) and (less than or equal to 6) [I'm assuming "between" is inclusive in your question.]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!