This might be a very simple problem, but I want to use the simulation time in order to execute a function while the simulation is running. For example, when the simulation time is larger than 14 secs (or >=14 & <20 s)
, then change the values of parameters. Please help me, the following code doesn't do anything. Thanks.
a=0;
set_param('model','SimulationCommand','Start');
b=0;
for i=1:1:500000 % 1ms sampling rate
timer(:,1)=get_param('model','SimulationTime');
if timer>=14
a=1;
b=1;
end
end