I have a code environment which consists of a Matlab AppDesigner app, a Simulink model and a few Matlab Script functions. The workflow is as follows:
- The user defines input values and simulation options in the AppDesigner's GUI, and starts the simulation by pressing a button;
- These variables are exported to Matlab's Workspace using the "assignin" function;
- The Simulink model is programatically executed with a Script;
- The outputs of the Simulink model are exported back to Matlab's workspace;
- The Script functions perform post-processing calculations on the Simulink outputs;
- The results are imported back to the AppDesigner GUI using the "evalin" function to be plotted for the user to see them.
Is there a simpler or more organized way to do this communication between Matlab, Simulink and AppDesigner? Is it better to not use AppDesigner altogether?
Also, is it possible to export the variables from AppDesigner as fields of a Struct to have a more organized workspace? The number of variables is very large.