matlab.metadata.ArrayDimension - Size information for property validation - MATLAB (original) (raw)
Main Content
Namespace: matlab.metadata
Superclasses: matlab.mixin.Heterogeneous
Size information for property validation
Renamed from meta.ArrayDimension
in R2024a
Description
matlab.metadata.ArrayDimension
is an abstract class used to define subclasses that represent the size information defined by property validation. These subclasses enable a complete description of property size information:
- matlab.metadata.FixedDimension - Dimension specified as a fixed numeric value
- matlab.metadata.UnrestrictedDimension - Dimension specified as a colon, which indicates any value is allowed
Version History
Introduced in R2018a
The namespace of ArrayDimension
has been changed frommeta
to matlab.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.ArrayDimension
instance, the code under the case
statement for'meta.ArrayDimension'
does not execute becauseclass(mObj)
returns'matlab.metadata.ArrayDimension'
.
switch class(mObj) case 'meta.ArrayDimension' % code to execute if mObj is a % meta.ArrayDimension 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.ArrayDimension') % code to execute if mObj is a % matlab.metadata.ArrayDimension instance else ... end
If compatibility with older releases of MATLAB is not a concern, you can update'meta.ArrayDimension'
to'matlab.metadata.ArrayDimension'
. However, continue to use the old name if your code needs to run on versions of MATLAB before R2024a.