How to get row index of certain values in a vector
6 ビュー (過去 30 日間)
古いコメントを表示
I am looking for a way to extract the row index of certain values from a vector.
I tried with
[ ~ , index ] = max(obj.GanttM(:,2)==i);
This only gives me one index but the number i appears several times. How can I extract all row indeces with one command?
Thank you.
0 件のコメント
採用された回答
Image Analyst
2013 年 12 月 28 日
Use find() instead:
rows = find(obj.GanttM(:,2)==i);
1 件のコメント
Image Analyst
2018 年 7 月 29 日
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!