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