Simulation manager with initFcn
41 ビュー (過去 30 日間)
古いコメントを表示
I'd need to run multiple simulation runs with using Simulation Manager "Multiple Simulations". My simulik model uses InitFcn callback function to initializate the model via matlab m-script. There are params which needs to be change per multiple simulation runs.
As pictured, I'd need to Vd_hfi to be change per simulation runs, it s defined in "init_model" m-script and this variable is used in Simulink model block.
As of now I am not able to chne the params for different values per simulations runs....
Is it possible to achieve this and so how?
0 件のコメント
回答 (1 件)
Fangjun Jiang
2025 年 2 月 19 日 14:38
'InitFcn' is executed before the simulation starts, that is probably the reason that your parameter values set in the multiple simulation are over-written.
Usually, you can move the function calls in 'InitFcn' to 'PreLoadFcn' or 'PostLoadFcn' if it is only to set up some parameter values. Then use Simulation Manager to set up all the parameter values that need to be different between each simulation.
16 件のコメント
Fangjun Jiang
2025 年 2 月 25 日 15:26
Either remove these statements, or move the "init_model" to PreLoadFcn and set your own InitFcn.
参考
カテゴリ
Help Center および File Exchange で Verification, Validation, and Test についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!