MATLAB: Should one use class and enumeration instead of structures? and what effect MATLAB will result after using class and enumeration

classes and enumerationsoop

classdef someClass
enumeration
end
end

Best Answer

I always use classes over structures as they are a lot more different in Matlab than e.g. C++.
A struct is just a christmas tree that you can hang anything off at any time you want. Very nice and convenient, but can be a nightmare for debugging, sharing code amongst others, readability, etc etc because just by looking at a piece of code you have no idea what fields are on a struct at any given moment unless it is entirely defined and limited to the scope you are looking at.
A class defines clearly what its properties are and obviously has the big advantage of wrapping methods up with those too (i.e. like a class in any language).
I would never really compare specifically an enumeration with a struct though. Where I don't use an enumeration I generally use strings instead, I have never considered a struct to be in any way an alternative to an enumeration.
You need to expand on your question though if you want an answer more tailored to what you want. You didn't ask anything at all or explain what you want t o know in the body of your question.