matlab.metadata.Event - Describe event defined by MATLAB class - MATLAB (original) (raw)
The namespace and class name of meta.event
have been changed tomatlab.metadata.Event
. 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.Event
instance, the code under the case
statement for 'meta.event'
does not execute becauseclass(mObj)
returns 'matlab.metadata.Event'
.
switch class(mObj) case 'meta.event' % code to execute if mObj is a meta.event 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.event') % code to execute if mObj is a matlab.metadata.Event instance else ... end
If compatibility with older releases of MATLAB is not a concern, you can update 'meta.event'
to'matlab.metadata.Event'
. However, continue to use the old name if your code needs to run on versions of MATLAB before R2024a.