Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Nathan Garcia
Nathan Garcia le 7 Août 2019
Commenté : Nathan Garcia le 7 Août 2019
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)

Réponse acceptée

Bruno Luong
Bruno Luong le 7 Août 2019
h = find(vec==26 | vec==437)
or
h = find(ismember(vec,[27 437]))

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by