matlab.metadata.Method Class
Namespace: matlab.metadata
Superclasses: matlab.metadata.MetaData
Description
The matlab.metadata.Method class provides information about the methods of
MATLAB® classes. Properties of the matlab.metadata.Method class
correspond to method attributes and other information that is specified syntactically in the
class definition. All properties are read-only.
The matlab.metadata.Method class is a handle class.
Class Attributes
Abstract | true |
ConstructOnLoad | true |
For information on class attributes, see Class Attributes.
Creation
You cannot instantiate a matlab.metadata.Method object directly, but there
are two ways to obtain an object.
From the
MethodListproperty of amatlab.metadata.Classobject —MethodListcontains an array ofmatlab.metadata.Methodobjects, one for each class method.For example, in this code, replace
ClassNamewith the name of the class whose methods you want to query.mlist(1).Namethe name of the first method in theMethodListproperty.mco = ?ClassName; mlist = mco.MethodList; mlist(1).Name;
Calling
metafunction(since R2026a) — This function returns amatlab.metadata.Methodinstance for a particular class and method name. ReplaceClassNameandMethodNamewith the name of the method you want to query.mObj = metafunction("ClassName/MethodName")