p = Pump;
p.Speed = 'm'p =Pump with properties:Speed: MediumThe numerical value is available from the property.getGPM(p)Flow rate is: 50 GPMFor information about enumeration classes, see “Define Enumeration Classes” on page
14-5.Integer Class ValidationMATLAB supports several integer classes (see “Integers”). However, restricting a
property to an integer class can result in integer overflow. The resulting value can
saturate at the maximum or minimum value in the integer’s range.When integer overflow occurs, the value that is assigned to a property might not be the
value from the right side of the assignment statement.For example, suppose that you want to restrict a property value to a scalar uint8.classdef IntProperty
properties
Value(1,1) uint8
end
endAssigning a numeric value to the Value property effectively casts the numeric value to
uint8, but does not result in an error for out-of-range values.a = IntProperty;
a.Value = -10;
disp(a.Value)08 Properties — Storing Class Data