Calling a Simulink Function from an M-file script

Is there a way to call a Simulink Function from the callback script of a GUI? The best I can think of right now is to create an either-edge triggered subsystem that is triggered by toggling the 'sw' setting of a Manual Switch using a GUI callback, but this feels a little clunky to me. What I would really like to do is call a Simulink Function directly by name from an M-file (GUI callback), but I can't find any information on if that's possible.

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 12 月 3 日

0 投票

No, but you can simulate a model using sim() after having set up model parameters. https://www.mathworks.com/help/simulink/slref/sim.html#bvfe92n-simIn

カテゴリ

ヘルプ センター および File ExchangeProgrammatic Model Editing についてさらに検索

製品

リリース

R2017b

タグ

質問済み:

2018 年 12 月 3 日

回答済み:

2018 年 12 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by