Clear the class to reload the definition of the HandleColors class:clear classes
a = HandleColors.Red;
a.Rans =1To prevent reassignment of a given property value, set that property's SetAccess
attribute to immutable.Equality of Handle-Based EnumerationsAssign two variables to a particular enumeration member:a = HandleColors.Red;
b = HandleColors.Red;Compare a and b using isequal:isequal(a,b)ans =1The property values of a and b are the same, so isequal returns true. However, unlike
handle classes that are not enumeration classes, a and b are the same handle because
there is only one enumeration member. Determine handle equality using == (the handle
eq method).a == bans =1See the handle eq method for information on how isequal and == differ when used
with handles.14 Enumerations