How to build, connect to target and run a simulink model with GUI?

13 Ansichten (letzte 30 Tage)
Ive made a simulink model and a GUI over which I insert the values of the variables used in the simulink model and when I insert those values and run the model over the GUI with
load_system('untitled'); set_param('untitled','SimulationCommand','start');
everything workes fine, and I can see the end result in the GUI axes.
Now the problem is when I put the model in real-time, it just wont work. I need to somehow build the model, connect to target and run it. I want to be able to follow the results in the axes in the GUI.
I hope somebody can help me!

Akzeptierte Antwort

Kaustubha Govind
Kaustubha Govind am 17 Jun. 2014
If you'd like to access data during simulation, please follow the methodology described here.
  4 Kommentare
Amir
Amir am 18 Jun. 2014
Cant find the answer here. my simulation is very simple and I just want to view the scope results in real time in my GUI axes, but cant fix it.
Kaustubha Govind
Kaustubha Govind am 19 Jun. 2014
Amir: That specific task can be accomplished by the technique described in the documentation linked in my original answer. Not sure why it didn't help you. Are there error messages?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Amir
Amir am 23 Jun. 2014
is there a way to make a loop to pause my simulation every 10 seconds and plot the result and then continue the simulation and pause again and plot,... end time is 1000.
set_param(gcs,'SimulationCommand','start'); set_param(gcs,'SimulationCommand','pause'); % pause after 10second plot( ) set_param(gcs,'SimulationCommand','continue'); set_param(gcs,'SimulationCommand','pause'); % pause after 10second plot( ) set_param(gcs,'SimulationCommand','continue'); set_param(gcs,'SimulationCommand','pause'); % pause after 10second . . .
plot( )

Kategorien

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

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by