isprop for custom classes

조회 수: 5 (최근 30일)
Dmitry Borovoy
Dmitry Borovoy 2011년 9월 12일
Why isprop doesn't work for custom classes in Matlab versions earlier than 2011a? Even help shows that this feature works only for COM object. So how to check is property a property of my class? sorry for my english...

채택된 답변

Daniel Shub
Daniel Shub 2011년 9월 14일
I don't know why TMW only implemented isprop for custom classes in r2011a, but it is pretty easy to work around. To test if a string y is a property of an object obj:
x = metaclass(obj)
tf = ismember(y, {x.PropertyList.Name});
This doesn't do any error checking on obj or y. If you have r2011a you can see the copyrighted source code of TMW's implementation of isprop.
edit isprop
  댓글 수: 1
Dmitry Borovoy
Dmitry Borovoy 2011년 9월 25일
sorry, was offline

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by