App Designerで Simulinkのシミュレーション結果を逐次表示できますか?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 19 Mar 2021
Réponse apportée : MathWorks Support Team
le 19 Mar 2021
App Designer上の Axes に、Simulinkのシミュレーション結果を逐次更新しながら、plot 関数で表示する方法を教えてください。
Réponse acceptée
MathWorks Support Team
le 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コマンドにより座標軸に割り付けて描画を行えば、シミュレーションと連動してグラフが描画されるような動きを実現することは可能です。
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!