Using find() on a vector of objects

4 visualizaciones (últimos 30 días)
Niklas
Niklas el 16 de Mayo de 2011
I'm trying to use find(...) to locate objects in a vector but can't make it work. I thought the following syntax would work:
p = find( obj.x == 1 )
but it doesn't. Why?

Respuesta aceptada

Robert Cumming
Robert Cumming el 16 de Mayo de 2011
do you want:
p = find ( [obj.x] == 1 )
if not, as suggested earlier can you show obj.x and the error message you get.
  1 comentario
Niklas
Niklas el 16 de Mayo de 2011
This is exacly what i was looking for, thanks!
How come you need the extra brackets?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Performance and Memory 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