How do I write a statement that will discard any values in an array if they are over a certain value?
3 ビュー (過去 30 日間)
古いコメントを表示
I want to say that if my height variable is > 1 then not to return the value in my matrix?
3 件のコメント
José-Luis
2013 年 5 月 16 日
It is easier to import everything to Matlab and then do the processing. Alternatively you could preprocess in Excel if you are more comfortable doing that.
回答 (1 件)
Ken Atwell
2013 年 5 月 16 日
I think you're looking for logical indexing:
heights = .1:.3:2
heights < 1
heights(heights<1)
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!