Does Octave support Matlab like enum?

Does Octave support enumeration like Matlab?
I have not found any information on this.

We can create an enumeration class by adding an enumeration block to the class definition. For example, the WeekDays class lists many days of the week (from the Matlab doc).

%file WeekDays.m
classdef WeekDays
   enumeration
      Monday, Tuesday, Wednesday, Thursday, Friday
   end
end

      

And it works well in Matlab and I access the enum values ​​as

x = WeekDays.Tuesday;

      

but Octave does not compile this line even though the WeekDays.m file was compiled by Octave without errors.

+3


source to share


1 answer


I believe there is experimental support for OO based code in Octave 4.0 classdef

, including enumeration

.



Edit: It looks like I was wrong and enums are not supported yet, as pointed out in the comment below from @carandraug (who I think is the Octave developer, so probably knows me better).

0


source







All Articles