This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

meta.MetaData class

Package: meta
Superclasses: matlab.mixin.Heterogeneous

Superclass for MATLAB object metadata


The meta.MetaData class of objects represent MATLAB® class definitions and the constituent parts of those definitions, such as properties and methods. Metadata enable a program to get information about a class definition.

The meta.MetaData class forms the root of the metadata class hierarchy, which enables the formation of arrays of metadata objects belonging to different specific classes.

MATLAB uses instances of the meta.MetaData class as the default object to fill in missing array elements.

findobj and findprop, can search the metadata hierarchy and return an array of different metadata objects. These function require the ability to form heterogeneous arrays containing various metaclass objects.

See the matlab.mixin.Heterogeneous class for more information on heterogeneous hierarchies.


You cannot create an instance of the meta.MetaData class directly. MATLAB constructs instances of this class as required.

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects in the MATLAB documentation.


This example shows how the meta.MetaData class facilitates working with metaclasses.

Create a meta.class instance representing the MATLAB timeseries class:

>> mc = ?timeseries;

MATLAB uses meta.MetaData objects to fill empty array elements:

>> m(2) = mc
>> class(m(1))

ans =

>> class(m(2))

ans =


Use findobj to find all properties and methods that have protected access:

>> protectedMembers = findobj(mc,{'Access','protected'},...

The timeseries class defines both properties and methods that have protected access. Therefore, findobj returns a heterogeneous array of class meta.MetaData. This array contains both and meta.method objects.

>> protectedMembers

protectedMembers = 

  11x1 heterogeneous meta.MetaData (, meta.method) 
  handle with no properties.
  Package: meta
>> class(protectedMembers(1))

ans =

>> protectedMembers(1).Name

ans =

>> protectedMembers(1).SetAccess

ans =

>> protectedMembers(1).GetAccess

ans =

Was this topic helpful?