What is the best way to do some calculation within a state in stateflow?
4 ビュー (過去 30 日間)
古いコメントを表示
Tharindu Weerakoon
2016 年 9 月 26 日
コメント済み: Tharindu Weerakoon
2016 年 9 月 30 日
Dear all, I'm bit confused of selecting a method to do some calculating program in a 'State' of the Stateflow. I do have to calculate some values checking some external measurements within a 'State'. I used to write some codes of calculation in the state block like Matlab script, but I then moved this code to Matlab Function block, since the state machine just better to show the state changes visually. Still, I am looking for the best way of doing such thing in sateflow while minimizing the execution time. Can anyone suggest me a better way to do such things (writing matlab codes in stateflow states)?
0 件のコメント
採用された回答
Zhao Wang
2016 年 9 月 28 日
I understand that you want to find a better way to write MATLAB code in Stateflow states. I am not sure in what sense you mean better. It might be shorter execution time, easier maintenance, or something else.
I assume you want to make the Stateflow chart easier to change than directly editing MATLAB code in a 'State'. In order to achieve this, you can include MATLAB functions in a Stateflow chart. Refer to the following link for more details about using MATLAB functions in a Stateflow chart:
If you have any specific question, you can contact MathWorks Technical Support for further assistance.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!