meta.FixedDimension class

Package: meta
Superclasses: meta.ArrayDimension

Fixed dimension in property size specification

Description

The meta.Validation class Size property uses meta.FixedDimension objects to represent the fixed values in a property size specification. The object Length property contains the numeric value of the dimension.

Properties

expand all

Fixed dimension, specified as scalar uint64.

Attributes:

GetAccesspublic
SetAccessprivate

Data Types: uint64

Attributes

Sealedtrue

For information on class attributes, see Class Attributes.

Examples

Find the fixed dimensions in a property validation.

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

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

Read the dimensions into a cell array.

mc = ?ValidationExample;
mp = findobj(mc.PropertyList,'Name','Prop');
sz = mp.Validation.Size;
len = length(sz);
dim = cell(1:len);
for k = 1:len
   switch class(sz(k))
      case 'meta.FixedDimension'
         dim{k} = sz(k).Length;
      case 'meta.UnrestrictedDimension'
         dim{k} = ':';
   end
end

Introduced in R2018a