Hi all,
I am trying to run a Simulink model with 12 "In" blocks and 4 "out" blocks" using a Matlab script.
One of those 12 inputs is a variable called "input_boucle" which is initially set at value 0.
I would like the simulation to last 5 seconds and at time = 3 seconds, I want the "input_boucle" variable to switch from 0 to 1 for the remaining of the simulation.
My initial script was quite simple:
options = simset('SrcWorkspace','current', 'fixedstep', T_s) ;
sim('test_all_InOut_Blocks.slx',t_stop, options);
I would like to have something like this:
save_mat_file_InOut_blocks;
T_s = t_stop_ouverte/1000;
options_boucle_ouverte = simset('SrcWorkspace','current', 'fixedstep', T_s) ;
sim('test_all_InOut_Blocks.slx',t_stop_ouverte, options_boucle_ouverte)
set_param('test_all_InOut_Blocks','SimulationCommand','pause')
input_Boucle.signals.values = double(0);
set_param('test_all_InOut_Blocks','SimulationCommand','continue')
I understand that this is the way:
With the assertion having for command:
set_param(bdroot,'SimulationCommand','pause'),
disp(sprintf('\nSimulation paused.'))
But how can I integrate my inital model to this model?
Would anyone know how to solve my issue?
Thanks in advance!