Get results from simulink and plot in GUI

5 Ansichten (letzte 30 Tage)
Loong
Loong am 30 Apr. 2012
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.

Akzeptierte Antwort

TAB
TAB am 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).
See a good example here.
  1 Kommentar
Loong
Loong am 30 Apr. 2012
Thank you very much....
I will try by using this two methods.
Appreciate to get from your help when I encounter any problem in the next.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu View and Analyze Simulation Results finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by