Using find() on a vector of objects

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일

0 개 추천

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개)

카테고리

도움말 센터 및 File Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by