I define an enumerated type in MATLAB
classdef(Enumeration) Color < Simulink.IntEnumType enumeration RED(0), GREEN(1), BLUE(2), end end
I can assign it:
>> x = Color.RED x = RED
I can display it like this:
>> disp(x) RED
or how is it
>> x.display() x = RED
How to access this name ("RED") as a string?
In other words, I'm looking for something like:
s = x.toString()
or
s = tostring(x)
both of them do not work.
enums oop matlab
Philipp
source share