在Stateflow中可以使用duration函数进行计时事件持续的时间。具体使用方法可以参考Stateflow的帮助文档:《Stateflow User Guide》。
1 语法
duration(C)
C is an expression that evaluates to true or false.
Returns the number of seconds since the conditional expression C became true and the associated state became active.
The value of the duration operator is reset if the conditional expression becomes false or if the associated state becomes inactive.
2 案例1

c的输出结果:

备注:
- duration在2016版的Matlab中不支持,但是2018版的Matlab中可以运行。如果在16版中运行会出现报错“The 'duration' class does not support code generation.”
参考文献:
《Stateflow User Guide》Use Actions in Charts
Control Chart Execution by Using Temporal Logic
最后
以上就是哭泣香菇最近收集整理的关于Stateflow_duration计时1 语法2 案例1备注:参考文献:的全部内容,更多相关Stateflow_duration计时1内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复