How to add a Stateflow chart in an existing Simulink model using API?

5 ビュー (過去 30 日間)
Tahir
Tahir 2012 年 11 月 16 日
コメント済み: Tonghui Zhang 2019 年 9 月 24 日
Consider an existing Simulink model with several subsystems connected with each other through ports and connectors. I want to know how to add Stateflow Chart within the subsystems using the API.
With the commands 'sfnew' and 'stateflow' I can only generate a new Simulink model with Stateflow Chart instead of adding a chart into an already existing model.

採用された回答

Jason Ghidella
Jason Ghidella 2012 年 11 月 16 日
編集済み: Jason Ghidella 2012 年 11 月 16 日
You can use the add_block function to add a Stateflow chart to an existing subsystem.
So for example, to add a Stateflow chart to a subsystem called "Subsystem" in a model called "my_model", and name that chart, "MyChart", you would use the following command:
add_block('sflib/Chart','my_model/Subsystem/MyChart')
  2 件のコメント
Sriragavi R
Sriragavi R 2017 年 6 月 16 日
The library 'sflib/Chart' is not working in Matlab 2012a.Are there any alternatives to add stateflow to an existing simulink model?
Tonghui Zhang
Tonghui Zhang 2019 年 9 月 24 日
Hi,
I am confronted with a similar question. How can I add like state in a chart in my model?
Thanks in advance.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by