- Using model callbacks : You can call the optimization script to update the gain values in a callback function.
- Using MATLAB Fcn block : You can define custom functionality of the optimization in SImulink using a MATLAB Fcn block. Note that the MATLAB Fcn block can only utilize MATLAB language features that are supported for C/C++ code generation. In such a case, you can define your custom function as coder.extrinsic.
How to run .m file script from Simulink(eg.slx) and results of script should update in same Simulink(eg.slx) file
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
I have an optimisation algorithm in which it will find the best PID gain values for the given system,As of now the script is runing first and then the results are obtained. I want to call this script from a simulink were i kept my pid controller and the values should updated in the same simulink pid blocks.
0 件のコメント
回答 (1 件)
Salman Ahmed
2021 年 10 月 11 日
Hi Alex,
You can try the following to run your MATLAB script in Simulink:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で PID Controller Tuning についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!