Finding first value in an array equal to each number in a vector
3 ビュー (過去 30 日間)
古いコメントを表示
I can find the first value in test_array that is equal to 2 using the following:
find(test_array==2, 1, 'first')
But how do I find the first value in test_array that is equal to, say, a vector of values? So the first value, for example, that is equal to 3, the first value that is equal to 5, the first value that is equal to 7, etc.?
0 件のコメント
採用された回答
Walter Roberson
2023 年 4 月 22 日
See the second output of ismember() -- you might need to exchange the parameters
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!