c = methods(h)
c = methods(obj)
c = methods(className)
| Parameter | Description |
|---|---|
| h | a handle object |
| obj | a classdef object |
| className | a class name as a string, including package-qualified names |
| Parameter | Description |
|---|---|
| c | a cell of strings |
methods returns a cell of strings with public method names.
For classdef classes, methods declared with private or protected access are hidden from this list. Static methods are listed and can be called with ClassName.method.
For classdef object arrays, methods returns the public methods of the array element class.
clear classes
d = [tempdir(), 'nelson_help_methods/'];
mkdir(d);
filewrite([d, '/NelsonHelpMethodsPoint.m'], ["classdef NelsonHelpMethodsPoint"; " properties"; " X = 0"; " end"; " methods"; " function r = value(obj)"; " r = obj.X;"; " end"; " end"; "end"]);
addpath(d);
a = NelsonHelpMethodsPoint();
b = NelsonHelpMethodsPoint();
m = methods([a, b])
| Version | Description |
|---|---|
| 1.0.0 | initial version |
| 2.0.0 | classdef class name support added |
| 2.0.0 | classdef object array support added |