Find indexes of variables in vector
1 回表示 (過去 30 日間)
古いコメントを表示
I need to find indexes of variables in vector which are eg. out of my set range.
Range eg. from 600 to 2000
Vector of 1000 variables and I need only indxes of that variables which are out of this range.
Any ideas?
0 件のコメント
採用された回答
the cyclist
2013 年 8 月 12 日
編集済み: the cyclist
2013 年 8 月 12 日
If x is your vector, then
idx = (x<600) | (x>2000);
is a logical index pointing to the out-of-range values.
If you need the actual positions,
idx = find((x<600) | (x>2000));
1 件のコメント
Andrew Reibold
2014 年 7 月 15 日
Thanks cyclist. Didn't realize you could use | or & in the find command.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!