MATLAB Answers

Kalle
0

Access SIMULINK simulation time while it runs.

Asked by Kalle
on 13 Jul 2014
Latest activity Commented on by Kalle
on 14 Jul 2014
I made a simulink model and can simulate it without any problems. I made a variable called simulation_stop_time and instead of changing the simulation time manually I am changing this variable in a matlab script.
Is there a way I can access the simulation time when it goes from 0 - simulation_stop_time? I want to start some functions when the simulation time is in between start to end like this:
if simulation_stop_time > 20
signal = 1
else
signal = 0;
end
because if I try to do this, the simulation_stop_time will always be the same value and doesnt change while the simulation runs.
Is there a way to access this simulation while it runs?

  0 Comments

Sign in to comment.

1 Answer

Answer by Rashmil Dahanayake on 14 Jul 2014
 Accepted Answer

use clock block

  1 Comment

Thank you very much. I have been searching for this kinda block for a long time now. Have a great day.

Sign in to comment.