res = ismethod(h, methodname)
res = ismethod(obj, methodname)
res = ismethod(className, methodname)
| Parameter | Description |
|---|---|
| h | a handle object |
| obj | a classdef object |
| className | a class name as a string |
| methodname | a string |
| Parameter | Description |
|---|---|
| res | a logical: true or false |
ismethod returns a logical 1 if the method is a public method of the object or class and a logical 0 otherwise.
For classdef classes, private and protected methods are not reported as public methods.
d = [tempdir(), 'nelson_help_ismethod/'];
mkdir(d);
filewrite([d, '/NelsonHelpIsMethodPoint.m'], ["classdef NelsonHelpIsMethodPoint"; " methods"; " function r = value(obj)"; " r = 1;"; " end"; " end"; "end"]);
addpath(d);
tf = ismethod('NelsonHelpIsMethodPoint', 'value')
| Version | Description |
|---|---|
| 1.0.0 | initial version |
| 2.0.0 | classdef class name support added |