| Contents | Index |
Instances of the meta.class class contains information about MATLAB classes. The read/write properties of the meta.class class correspond to class attributes and are set only from within class definitions on the classdef line. You can query the read–only properties of the meta.class object to obtain information that is specified syntactically by the class (for example, to obtain the name of the class).
You cannot instantiate a meta.class object directly. You can construct a meta.class object from an instance of a class or using the class name:
metaclass — returns a meta.class object representing the object passed as an argument.
?ClassName — returns a meta.class object representing the named class.
fromName — static method returns a meta.class object representing the named class.
For example, the metaclass function returns the meta.class object representing MyClass.
ob = MyClass; obmeta = metaclass(ob); obmeta.Name ans = MyClass
You can use the class name to obtain the meta.class object:
obmeta = ?MyClass;
You can also use the fromName static method:
obmeta = meta.class.fromName('MyClass');| Property | Purpose |
|---|---|
AllowedSubclassesattribute, write only from classdef statement | List classes that can subclass this class. Specify subclasses as meta.class objects in the form:
Specify meta.class objects using the ?ClassName syntax only. |
| ConstructOnLoad attribute, default = false | If true, the class constructor is called automatically when loading an object from a MAT-file. Therefore, the construction must be implemented so that calling it with no arguments does not produce an error. |
| ContainingPackage read only | A meta.package object describing the package within which this class is contained, or an empty object if this class is not in a package. |
| Description read only | Currently not used |
| DetailedDescription read only | Currently not used |
| EventList read only | An object array of meta.event objects describing each event defined by this class, including all inherited events. |
| Events read only Use EventList instead | A cell array of meta.event objects describing each event defined by this class, including all inherited events. |
| EnumerationMemberList | An object array of meta.EnumeratedValue objects describing the member names defined by an enumeration class. See Enumerations for more information on enumeration classes. |
| EnumeratedValues read only Use EnumeratedMemberList instead | A cell array of meta.EnumeratedValue objects describing the member names defined by an enumeration class. See Enumerations for more information on enumeration classes. |
| Hidden attribute, default = false | If set to true, the class does not appear in the output of MATLAB commands or tools that display class names. |
| InferiorClasses attribute, default = {} | A cell array of meta.class objects defining the precedence of classes represented by the list as inferior to this class. See Class Precedence |
| MethodList read only | An object array of meta.method objects describing each method defined by this class, including all inherited public and protected methods. See How to Use Methods. |
| Methods read only Use MethodList instead | A cell array of meta.method objects describing each method defined by this class, including all inherited public and protected methods. |
| Name read only | Name of the class associated with this meta.class object (char array) |
| PropertyList read only | An object array of meta.property objects describing each property defined by this class, including all inherited public and protected properties. |
| Properties read only Use PropertyList instead | A cell array of meta.property objects describing each property defined by this class, including all inherited public and protected properties. |
| Sealed attribute, default = false | If true, the class cannot be subclassed. |
| SuperClassList read only | An object array of meta.class objects describing each direct superclass from which this class is derived. |
| SuperClasses read only Use SuperClassList instead | A cell array of meta.class objects describing each direct superclass from which this class is derived. |
| Method | Purpose |
|---|---|
| fromName | Returns the meta.class object associated with the specified class name. |
| tf = eq(Cls) | Equality function (a == b). Use to test if two variables refer to equal classes (classes that contain exactly the same list of elements). |
| tf = ne(Cls) | Not equal function (a ~= b). Use to test if two variables refer to different meta–classes. |
| tf = lt(ClsA,ClsB) | Less than function (ClsA < ClsB). Use to determine if ClsA is a strict subclass of ClsB (i.e., a strict subclass means ClsX < ClsX is false). |
| tf = le(ClsA,ClsB) | Less than or equal to function (ClsA <= ClsB). Use to determine if ClsA is a subclass of ClsB. |
| tf = gt(ClsA,ClsB) | Greater than function (ClsB > ClsA). Use to determine if ClsB is a strict superclass of ClsA (i.e., a strict superclass means ClsX > ClsX is false). |
| tf = ge(ClsA,ClsB) | Greater than or equal to function (ClsB >= ClsA). Use to determine if ClsB is a superclass of ClsA. |
fromName | meta.event | meta.method | meta.package | meta.property
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |