So I have a structure with lots of fields and corresponding values. So for instance if I want to find the indexes for a range of 100-150 how would I do this? The find function doesn't seem to work for a vector: Select_struct=find([file.Position]==100:150)

 Respuesta aceptada

Adam
Adam el 7 de Feb. de 2017
Editada: Adam el 7 de Feb. de 2017

1 voto

[~,matchingIdx] = ismember( [file.Position], 100:150 );
or
[~,matchingIdx] = ismember( 100:150, [file.Position] );
depending which way round you want the indices.

Más respuestas (0)

Categorías

Más información sobre Data Types en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 7 de Feb. de 2017

Editada:

el 7 de Feb. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by