| MATLAB® | ![]() |
The meta.method class provides information about the methods of MATLAB classes. The read/write properties of the meta.method class correspond to method attributes and are specified only from within class definitions.
You can query the read-only properties of the meta.method object to obtain information that is specified syntactically by the class (for example, to obtain the name of the class defining a method).
Obtain a meta.method object from the meta.class Methods property, which contains a cell array of meta.method objects, one for each class method. For example:
mco = ?classname;
methodcell = mco.Methods;
methodcell{1}.Name; % name of first method
Use the metaclass function to obtain a meta.class object from a class instance:
mco = metaclass(obj);
| Property | Purpose |
|---|---|
| Abstract | If true, the method has no implementation. The method has a syntax line that can include arguments, which subclasses use when implementing the method.
|
| Access attribute, default = false | Determines what code can call this method.
|
| DefiningClass | The meta.class object representing the class that defines this method. |
| Description read only | Currently not used |
| DetailedDescription read only | Currently not used |
Hidden attribute, default = false | When false, the method name shows in the list of methods displayed using the methods or methodsview commands. If set to true, the method name is not included in these listings. |
| Name read only | Name of the method. |
| Sealed attribute, default = false | If true, the method cannot be redefined in a subclass. Attempting to define a method with the same name in a subclass causes an error. |
| Static attribute, default = false | Set to true to define a method that is not depend on an object of the class and does not require an object argument. You must use class name to call the method: classname.methodname See Static Methods |
meta.class, meta.property, meta.event, metaclass
Methods — Defining Class Operations
Obtaining Information About Classes with Meta-Classes
![]() | meta.event | meta.package | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |