This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


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