Simulink上で計算した値をMatlabの.mファイルの計算部分に組み込む方法はありますか?
Afficher commentaires plus anciens
添付したSimulinkモデルのようにFcnブロックで計算値を.mファイルのプログラム(計算部分)に組み込んで 計算をしたいのですが、組み込む方法はあるでしょうか?
よろしくお願いします。
Réponses (1)
Teja Muppirala
le 16 Oct 2017
まず出力したい信号にOutportをつなげて、
"sim" コマンドでモデルを実行し、出力の値を取得したらどうでしょうか。
結果が時間に依存しないのであれば、シミュレーションの停止時間を0(zero)にしてもいいです。
例えば:
simOut = sim('help20171016','SaveFormat','Array','SaveOutput','on','StopTime','0');
b = simOut.get('yout')
1 commentaire
T S
le 26 Oct 2017
Catégories
En savoir plus sur Simulink dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!