Is it possible to define multiple enumerations in a single Matlab file? Or is it possible to have "local" enums in the same way we can define local funtions at the end of a file?
I am working on a project where it would be handy to have multiple enumeration classes, but it is annoying to use a classdef every time because it requires a separate file, and this means that there are lots of short files whose sole purpose it is to define enumerations. At the moment, each enumeration looks like this:
classdef exampleEnumType < uint32
enumeration
zero(0),
one(1),
two(2),
end
end
Is there a way to compactly define enumerations in Matlab so that I do not need a separate file for each (using Matlab 2021a)?
You can use a map...
usage looks like