isprop
Determine if property is defined by object
Description
returns logical tf
= isprop(obj
,PropertyName
)1
(true
) if the specified
PropertyName
is a property of object obj
.
Otherwise, isprop
returns 0
(false
). If obj
is an array,
isprop
returns a logical array the same size as obj
.
Each true element of tf
corresponds to an element of
obj
that has the property PropertyName
.
Examples
Input Arguments
Limitations
Classes can control access to property values by defining property attributes. For example, a property can be
private
, which means it is readable and writable only inside the class that defines it.isprop
indicates that these properties exist regardless of whether you have direct access to that property. For more information, see Property Attributes.isprop
always returnsfalse
when called with any value type ofPropertyName
other than a character vector or string scalar. For example, if you pass in a string array forPropertyName
,isprop
returnsfalse
even if one or more of the array elements are properties of the object.If
obj
is an empty object or an array of empty objects,isprop
returns an empty logical array, even ifPropertyName
is a property ofobj
.
Extended Capabilities
Version History
Introduced before R2006a