Using find() on a vector of objects

4 次查看(过去 30 天)
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?

采纳的回答

Robert Cumming
Robert Cumming 2011-5-16
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 个评论
Niklas
Niklas 2011-5-16
This is exacly what i was looking for, thanks!
How come you need the extra brackets?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Performance and Memory 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by