Run simulink model (slx format) in m-file

71 ビュー (過去 30 日間)
amin
amin 2017 年 1 月 23 日
コメント済み: Mohsen Asaadi 2022 年 3 月 7 日
Hello I have a model in simulink and need to set constant parameters from m file. the names of the model and mfile are different. instead of values in the content box in the model I used the variable name: 'H_move' I used the simset() function to import the values but got these errors:
Unrecognized property name 'H_move'. or this one block_diagram does not have a parameter named 'H_move'
I searched a lot but could not recognize the problem. Best Regards Amin

回答 (1 件)

Easwar Kumar Yarrabikki
Easwar Kumar Yarrabikki 2017 年 1 月 23 日
  • If I understand your question correctly,
  • What I usually do is, I initialize work space with all the constants first and then call the model from MATLAB Script. let assume
  • a=10;
  • b=10;
  • sim('mymodel') % running model from script*
  • Here my simulink model needs constants a and b as an inputs to run the simulation. Since I already loaded them into workspace it, MATLAB knows values for a and b, it will feed them to Simulink even you used a and b in your simulink model.
  1 件のコメント
Mohsen Asaadi
Mohsen Asaadi 2022 年 3 月 7 日
Thanks man

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePrepare Model Inputs and Outputs についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by