| Contents | Index |
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).
You cannot instantiate a meta.method object directly. Obtain a meta.method object from the meta.class MethodList property, which contains an array of meta.method objects, one for each class method. For example, replace ClassName with the name of the class whose methods you want to query:
mco = ?ClassName;
mlist = mco.MethodList;
mlist(1).Name; % name of first method in the list
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 = public | 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 methodsor 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 does not depend on an object of the class and does not require an object argument. Call static methods using the class name in place of the object: classname.methodname() Or with an instance of the class, like any method: o.methodname() See Static Methods |
meta.class | meta.event | meta.property | metaclass
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |