Main Content
ismethod
Determine if object has specified method
Description
returns logical tf
= ismethod(obj
,methodName
)1
(true
) if the specified methodName
is a nonhidden, public method of object obj
. Otherwise, ismethod
returns logical 0
(false
). The methodName
argument is the name of the method specified as a character vector or a string scalar.
ismethod
does not take class names specified as character vectors or strings as the first argument to identify a class. To list the methods defined by a class using its class name, use the methods
function.
Examples
Test for Equality
Determine if objects support equality testing before executing code.
if ismethod(obj1,'eq') && ismethod(obj2,'eq') tf = obj1 == obj2; end
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced before R2006a