Determine if method of object


tf = ismethod(obj,methodName)


tf = ismethod(obj,methodName) returns logical 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 accept class names specified as character vectors or strings as the first argument.

Use the methods function to list the methods of abstract classes.


Determine if objects support equality testing:

if ismethod(obj1,'eq') && ismethod(obj2,'eq')
   tf = obj1 == obj2;

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a