All char vectors in the cell array must correspond to an enumeration member defined by
the class.Coercion of char to EnumerationsMATLAB coerces char vectors into enumerations members when the dominant argument
is an enumeration. Because user-defined classes are dominant over the char class,
MATLAB attempts to convert the char vector to a member of the enumeration class.Create an enumeration array. Then insert a char vector that represents an enumeration
member into the array.a = [WeekDays.Monday,WeekDays.Wednesday,WeekDays.Friday]a =Monday Wednesday FridayAdd a char vector to the WeekDays array.a(end+1) = 'Tuesday'a =Monday Wednesday Friday TuesdayMATLAB coerces the char vector to a WeekDays enumeration member.class(a)ans =WeekDaysSubstitute Enumeration Members for char VectorsYou can use enumeration members in place of char vectors in cases where functions
require char vectors. For example, this call to sprintf expects a char vector,
designated by the %s format specifier.sprintf('Today is %s',WeekDays.Friday)ans =Today is Friday14 Enumerations
