State Transition with a time delay
이전 댓글 표시
I have a state transition which needs to be triggered when a condition is met for a fixed period of time.
In the example below, the response I would like is for the transition from the on to the off state to occur when the input is > 0 continuously for 5 seconds. If, during the 5 seconds input becomes <= 0 the state should remain on and the timer should reset. i.e. if input is > 0 again, it will wait for 5 seconds before transitioning to off.
The state machine below will transition to off instantly if input becomes > 0 after it has been in the on state for > 5 seconds.

Any help with resolving this problem is appreciated
답변 (1개)
Julia
2015년 6월 8일
0 개 추천
Hi,
you have to combine your two conditions with '&&'. That should solve your problem.
댓글 수: 2
Frazer Watson
2015년 6월 8일
Julia
2015년 6월 9일
Here is another solution. However, I did not use the after() command.
카테고리
도움말 센터 및 File Exchange에서 Stateflow에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
