Using find() on a vector of objects

조회 수: 4 (최근 30일)
Niklas
Niklas 2011년 5월 16일
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