3
有没有一种方法来检查给定的hobject的属性值是否有效? 我只是把'enable'属性作为一个例子,我的问题是针对一般属性,并且假设您事先并不知道所有可能接受的属性值。如何在Matlab中检查值是否有效属性?
% MyBtnObject is a standard push button
% this will be ok
set(MyBtnObject, 'enable', 'on');
% and this will not, but how can I check it?
set(MyBtnObject, 'enable', 'SomeInventedProp');
如何使用'try-catch'块? – 2011-03-27 15:12:52