Reset Clock Block - Matlab/Simulink
이전 댓글 표시
Hello,
i have the simulation time as an input singal coming from a Clock Block. On condition (for example: when another signal x is greater or equal to a constant a) i want the time signal, that comes from the Clock Block, to be set to 0 and restart counting up again while the simulation time keeps going.
I do not know how to do this and whether it is purposeful to use the Clock Block. I hope someone can help and thank in advance!
Cheers
답변 (1개)
Gayan
2017년 10월 27일
2 개 추천
Im not sure it is possible directly.
But there is a workaround. Instead of using the output of the clock directly modify it.
Method 1; Use If block in held option and substract the value. I use a pulse generator as the reset trigger. See the image below.


>>
Method 2, you can use a memory block to subtract a constant from the clock out.
Then new_clock = Clock - value stored in mem block. When ever you want to reset the clock just set the mem block value to Clock.
카테고리
도움말 센터 및 File Exchange에서 Sources에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!