pass a variable value from simulink to gui while running simulation
2 views (last 30 days)
Show older comments
I have a simulink model which generates the position of a link using simmechanics. I need to use this value for the gui graph, and live. Is there a solution to this problem, since simout is only post-execution?
0 Comments
Accepted Answer
Orion
on 19 Nov 2014
you can send your signal in an interpreted matlab function (or a S-function).
In this function (an external .m that you wrote), the code is executed at every step time during the simulation.
so you just have to get the handle of your gui components (with findall) and update your button / graphs wth the input signals.
6 Comments
Orion
on 20 Nov 2014
I have no idea what your data are.
To debug your problem, just remember that you are using a Mfile.
So you can put a breakpoint at the line 10 (and others if you want), then start the simulation, and every time your Mfile is called, the simulation will pause and you'll be inside the function.
And then, this no longer Simulink, but classic Matlab debugging.
More Answers (1)
See Also
Categories
Find more on Event Functions 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!