MATLAB: Pass a variable value from simulink to gui while running simulation

guisimulink

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?

Best Answer

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.