- Open your Simulink model.
- In the Simulink Editor, click on the "Simulation" tab.
- Under the "Model Configuration Parameters" section, click on "Data Import/Export."
- Configure the data you want to access.
- In MATLAB App create a button to start/stop the model
- Write a Callback function for the created button with the following code
- To access the runtime data from the Simulink model, you can use the simOut variable. It contains the simulation output, including signals, states, and other data. You can access specific data using the appropriate syntax. For example, in your case to access the signal named 'mySignal', you can use simOut.mySignal.