Track Time In stateflow

3 ビュー (過去 30 日間)
Alex Gimondi
Alex Gimondi 2018 年 6 月 11 日
回答済み: Muthukumar Ganesan 2022 年 7 月 28 日
Hello, I'm quite new to state flow diagram. They seem very powerful. I've followed some tutorials but I still don't get a thing. How can I keep track of time inside a state? I'll explain: let's suppose I want a ramp (or a sin) as output as a function of the time in the state out = A * t. Is there a simple way to get t? The only thing that I figured out is a self-transition every after(0.01,sec){t=t+0.01}. Thank you, Alex

回答 (1 件)

Muthukumar Ganesan
Muthukumar Ganesan 2022 年 7 月 28 日
Hi,
There are N number of ways to implement this logic. Here are some.
1. Using State action
on after(0.01,sec): t=t+0.01
2. Using Sample time
during: t=t+SAMPLE_TIME % where SAMPLE_TIME is defined in Workspace
Hope this helps. Thanks.

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

タグ

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by