matlab.metadata.FixedDimension Class
Namespace: matlab.metadata
Superclasses: matlab.metadata.ArrayDimension
Fixed dimension in property size specification
Renamed from meta.FixedDimension
in R2024a
Description
The matlab.metadata.Validation
class Size
property uses
matlab.metadata.FixedDimension
objects to represent the fixed
values in a property size specification. The Length
property
contains the numeric value of the dimension.
Properties
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 a fixed dimension and to what value that dimension is
restricted.
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.FixedDimension') disp("Dimension " + k + " has a fixed value of " + sz(k).Length + ".") end end
Dimension 1 has a fixed value of 2.