Access SIMULINK simulation time while it runs.

조회 수: 2 (최근 30일)
Kalle
Kalle 2014년 7월 13일
댓글: Kalle 2014년 7월 14일
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?

채택된 답변

Rashmil Dahanayake
Rashmil Dahanayake 2014년 7월 14일
use clock block
  댓글 수: 1
Kalle
Kalle 2014년 7월 14일
Thank you very much. I have been searching for this kinda block for a long time now. Have a great day.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by