How can I get and set variables like PID parameters in a Simulink model from an mfile?
6 ビュー (過去 30 日間)
古いコメントを表示
I want to carry simulink variable (eg. PID parameters)to mfile. After I process in mfile, I will send to simulink model. How can I do this. Could you suggest any way for me?
3 件のコメント
James Allison
2011 年 2 月 16 日
You have several options:
1) use get_param to obtain Simulink model parameters, and use set_param to set them
2) Use variables in your Simulink model parameters, and define them in the base workspace. You can set these values using your m file, and then run the Simulink model.
3) If you run your Simulink model using the sim command, you can pass in model parameter values.
回答 (3 件)
Paulo Silva
2011 年 2 月 14 日
doc open_system
doc load_system
doc set_param
doc sim
doc save_system
doc close_system
0 件のコメント
Kaustubha Govind
2011 年 2 月 15 日
You can log data from Simulink using the To Workspace block and import data back into the model using the From Workspace block.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Programmatic Model Editing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!