Get results from simulink and plot in GUI

9 visualizaciones (últimos 30 días)
Loong
Loong el 30 de Abr. de 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.

Respuesta aceptada

TAB
TAB el 30 de Abr. de 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 comentario
Loong
Loong el 30 de Abr. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre View and Analyze Simulation Results en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by