matlab.metadata.MetaData - Root of metadata class hierarchy - MATLAB (original) (raw)

Main Content

Namespace: matlab.metadata
Superclasses: matlab.mixin.Heterogeneous

Root of metadata class hierarchy

Renamed from meta.MetaData in R2024a

Description

The matlab.metadata.MetaData class forms the root of the metadata class hierarchy. Metadata objects represent MATLABĀ® class definitions and the constituent parts of those definitions, such as properties and methods. Metadata objects provide a programmatic interface to information about class definitions.

MATLAB uses instances of the matlab.metadata.MetaData class as the default object to fill in missing elements in arrays of metaclass objects.

Use the findobj and findprop methods of the handle class to search the metadata hierarchy for metadata objects. For information on using metadata, see Class Introspection and Metadata.

The matlab.metadata.MetaData class is a handle class.

Creation

You cannot create an object of this class directly. To access class metadata, use themetaclass function.

Version History

Introduced in R2008a

expand all

The meta.MetaData class is now matlab.metadata.MetaData. The behavior remains the same.

MATLAB will continue to recognize the old metaclass names in most contexts. However, code that relies on string comparisons to identify metaclasses might need to be updated to continue to work as expected. For example, if mObj in the example below is a matlab.metadata.MetaData instance, the code under thecase statement for 'meta.MetaData' does not execute because class(mObj) returns'matlab.metadata.MetaData'.

switch class(mObj) case 'meta.MetaData' % code to execute if mObj is a meta.MetaData instance ... end

To ensure this code continues to work as intended, use an if statement with isa. The isa command recognizes both the old and new names of the class.

if isa(mObj,'meta.MetaData') % code to execute if mObj is a matlab.metadata.MetaData instance else ... end

If compatibility with older releases of MATLAB is not a concern, you can update 'meta.MetaData' to'matlab.metadata.MetaData'. However, continue to use the old name if your code needs to run on versions of MATLAB before R2024a.