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

1 visualización (últimos 30 días)
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)

Respuesta aceptada

Bruno Luong
Bruno Luong el 7 de Ag. de 2019
h = find(vec==26 | vec==437)
or
h = find(ismember(vec,[27 437]))

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by