Simlinkで構造体を使用したい
Afficher commentaires plus anciens
Matlabで作成したシミュレーションを,Simlinkに移行しようとしています.
膨大な量のパラメータや条件を,グローバルな構造体で複数の関数に受け渡しています.
同じようなことをSimulinkでも行いたいです.
構造体を使うのは,すべて自分で用意したmatlab function内です.
グローバルな構造体は例えば
data.A.a = 1; data.A.b = 2; data.A.cd = [0 1];
data.B.typ = 'abc', data.B.d = 123;
data.C.C.C.c = [1 2 3; 4 5 6; 7 8 9];
といった具合に,最上階層はdataのみで,それ以下の階層では階層数や配列や文字列,数値が混在しています.
また初期化として,matalbコード上で構造体を作成し,ワークスペースからSimlinkに渡したいです.
Réponse acceptée
Plus de réponses (1)
Toshinobu Shintai
le 19 Juil 2019
0 votes
ワークスペースに構造体が定義されているのであれば、
以下の画像のように「Constant」や「String Constant」に直接入力することで使用することができます。
この方法で問題ありませんでしょうか。

1 commentaire
Kento SHIRAKATA
le 20 Juil 2019
Catégories
En savoir plus sur イベント関数 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!