Finding structure array entries with certain values
Mostrar comentarios más antiguos
Hello,
What is the way to find all structure array entries with specific values?
E.g. I tried:
find(cell_data.CN == 4)
But that returns:
Error using ==
Too many input arguments.
Kind regards,
Tom
Respuesta aceptada
Más respuestas (1)
Thomas
el 7 de Mzo. de 2014
You could use something like this
strs={'1' '2' '3' '4'}
ind=find(ismember(strs,'4'))
>> ind =
4
2 comentarios
Tom
el 7 de Mzo. de 2014
strs in the array of cells.. that I am defining above the find command to give the example..
try
strs ={cel_data.CN};
ind=find(ismember(strs,'4'))
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!