Is it possible to change a parameter in a Simulink model each time it is run via a for loop in a MATLAB script?

9 次查看(过去 30 天)
I am using the battery block within Simulink to explore how battery degradation changes with age of the battery. I want to be able to run the model with a specific parameter value set (age of battery in cycles). Then I want the data that is generated to be plotted on a figure. Then, via a for loop, I want to change the variable in the simulink model. The model will run again with the new variable. Then, the new data generated will be plotted on the figures created earlier to allow for data comparison. Then, the variable for the age of the battery in cycles will change again and the whole process will repeat for at least ten different ages.
Is there any way this can be implemented within Matlab and Simulink? Thank you.

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2023-2-27

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by