Simulation manager with initFcn

5 visualizaciones (últimos 30 días)
Peter
Peter el 19 de Feb. de 2025
Movida: Fangjun Jiang el 25 de Feb. de 2025
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?

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 19 de Feb. de 2025
'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 comentarios
Fangjun Jiang
Fangjun Jiang el 25 de Feb. de 2025
Either remove these statements, or move the "init_model" to PreLoadFcn and set your own InitFcn.
Peter
Peter el 25 de Feb. de 2025
Movida: Fangjun Jiang el 25 de Feb. de 2025
moving to PreLoadFcn does not work

Iniciar sesión para comentar.

Categorías

Más información sobre Verification, Validation, and Test en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by