isprop - Determine whether input is object property

Syntax

isprop(h, 'name')

Description

isprop(h, 'name') returns logical 1 (true) if the specified name is a property you can use with object h. Otherwise, isprop returns logical 0 (false).

Examples

Create a Microsoft® Excel® application and test to see if UsableWidth is a property of the object. isprop returns true:

h = actxserver ('Excel.Application');

isprop(h, 'UsableWidth')
ans =
     1

Try the same test on SaveWorkspace, which is a method, and isprop returns false:

isprop(h, 'SaveWorkspace')
ans =
     0

See Also

get(COM), inspect, addproperty, deleteproperty, ismethod, isevent, isobject, methods, class

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS