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

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.