MATLAB: How to programatically send Update Diagram command to Simulink

simulinkupdate diagram

I stumble upon a problem in my project, there's one GUI that controls the simulation and that GUI changes variables on MATLAB workspace, the same variables are used in the simulation but simulink doesn't read the new values unless the simulation stops and starts or the Update Diagram command is issued, so the question is how to force simulink to Update Diagram in my code?
Already tried:
eval([SimFileName '([],[],[],''update'')' ]);
but it doesn't do what I want.
Meanwhile I found one solution but it's using QuaRC MATLAB Functions, would be better to have something withing simulink functions.
qc_update_model
Any help is welcome, thanks

Best Answer

Use set_param('sys', 'SimulationCommand', 'cmd')?
where 'sys' is the name of the system and 'cmd' is 'start', 'stop', 'pause', 'continue', 'update', or 'WriteDataLogs'