Indexing numbers for 2 or more specific values in a vector?

1 回表示 (過去 30 日間)
Nathan Garcia
Nathan Garcia 2019 年 8 月 7 日
コメント済み: Nathan Garcia 2019 年 8 月 7 日
How can I find the index numbers for 2 or more specific values in a vector called vec? Something like h=find(vec==26 & vec==437)

採用された回答

Bruno Luong
Bruno Luong 2019 年 8 月 7 日
h = find(vec==26 | vec==437)
or
h = find(ismember(vec,[27 437]))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by