Get results from simulink and plot in GUI
5 views (last 30 days)
Show older comments
I would like to get the results from my simulink model and plot in the GUI, but I do not know how it can be done. I input a series of data x to my simulink model, and simulate series of data y. I just want to plot the data x (input data) against the time step, and another plot for output data y against the time step.
Can anyone please provide or explain to me how and what are the program should I write in GUI "plot push button"??
I am new in MATLAB.
0 Comments
Accepted Answer
TAB
on 30 Apr 2012
There are two way to get simulink simulation result outside the simulink.
1. Using To WorkSpace block:
Save the simulation data to base workspace using Sinks/ToWorkspace block (See here). Once simulation is complete and data is saved to matlab workspace, you can read & plot the data using m-script.
2. Using listener callback:
Create a callback function for the port whos data you want to access. Register this callback function with event listener. Advantage of using this method is that, you can access and plot the simulation data at run time (when the model is running).
More Answers (0)
See Also
Categories
Find more on View and Analyze Simulation Results in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!