Why Enumerated data type creation is not supported in Model Workspace?
Mostrar comentarios más antiguos
In MATLAB R2018b,
In model Workspace, there is no option available in object creation for Enumerated data type :

Also I would like to know if there is any possibility to define Enumeration in Model Workspace.
Respuestas (1)
Suman
el 27 de Jun. de 2024
0 votos
Hi MILI,
If you need to use enumeration data types in model workspace, you may use the following workarounds:
1) Copy data from base workspace to model workspace:
- Define an enumuration class to use in MATLAB. Please refer to this documentation to learn how to define enumeration classes: https://www.mathworks.com/help/matlab/matlab_oop/enumerations.html
- Create variables in MATLAB Workspace.
- Copy them to model workspace in Model Explorer.
2) Change MATLAB variable's data type to enum type
- Add a new MATLAB variable from Model Explorer toolstrip in model workspace
- Assign the value of that variable to the enum class value. It will change the data type of the variable to enum.
Categorías
Más información sobre Simulink Check en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!