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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by