Main Content

matlab.metadata.UnrestrictedDimension Class

Namespace: matlab.metadata
Superclasses: matlab.metadata.ArrayDimension

Unrestricted dimension in property size specification

Renamed from meta.UnrestrictedDimension in R2024a

Description

The matlab.metadata.Validation class Size property uses matlab.metadata.UnrestrictedDimension objects to represent the use of a colon in a property size specification. An instance of this class in the Size array indicates that the respective dimension in the property definition is a colon. A colon in a size specification indicates that any value is allowed.

Class Attributes

Sealedtrue

For information on class attributes, see Class Attributes.

Examples

The ValidationExample class specifies the size of the property value as (2,:).

classdef ValidationExample
   properties
      Prop (2,:) double {mustBeReal, mustBeGreaterThan(Prop, 10)} = 200;
   end
end

Programmatically determine if the property validation used for Prop has an unrestricted dimension.

mc = ?ValidationExample;
mp = findobj(mc.PropertyList,'Name','Prop');
sz = mp.Validation.Size;
len = length(sz);
for k = 1:len
   if isa(sz(k),'matlab.metadata.UnrestrictedDimension') 
         disp("Dimension " + k + " is unrestricted.")
   end
end
Dimension 2 is unrestricted.

Version History

Introduced in R2018a

expand all