App Designerで Simulinkのシ​ミュレーション結果を​逐次表示できますか?

2 views (last 30 days)
App Designer上の Axes に、Simulinkのシミュレーション結果を逐次更新しながら、plot 関数で表示する方法を教えてください。

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Mar 2021
イベントリスナー機能を使った方法によって実現可能です。
add_exec_event_listener:
例としては下記MATLAB Answers記事が参考になります。
How do I update a GUI designed in App Designer with data from a running Simulink model?:
添付ファイルは、上記Answers記事をベースとしてApp Desginer上でグラフを逐次プロットする例です。
方法としては、Interpreted MATLAB Functionブロックを使用して、信号をベースワークスペースに任意の変数名として逐次配列格納していきます。
そのためevalinやassigninを使用し、ベースワークスペースの毎周期における評価が必要となります。
ベースワークスペースに保存した配列結果をAppDesginer側のコールバックでevalinによって参照し、plotコマンドにより座標軸に割り付けて描画を行えば、シミュレーションと連動してグラフが描画されるような動きを実現することは可能です。

More Answers (0)

Categories

Find more on 一般分野への適用 in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!