I am trying to create a matlab gui that simulates a DC/DC converter, and I have succeeded in exporting data from gui to simulink in order to change signal attributes. The problem is that, when I change the values using the gui, the output signals on scopes in simulink change but the signals that I import from the simulation stay the same unless i re-run the simulation from simulink. I am using the evalin function to export workspace data to my m-file. I tried waiting for the simulation to end in order to solve the problem but it didn't. I hope the question was clear enough and thank you in advance for your help !
0
votes
1 Answers
0
votes
Thank you but the problem resided in the command i used to run the simulation and not waiting the proper amount of time in order for the simulation to finish.
To resolve this problem I used the following:
open_system('nameofmodel.mdl')
set_param('nameofmodel', 'SimulationCommand', 'start')
while ~strcmp(get_param ('nameofmodel','SimulationStatus'),'stopped')
pause(1e-99);
end