Is it possible to change a parameter in a Simulink model each time it is run via a for loop in a MATLAB script?
7 views (last 30 days)
Show older comments
Thomas Derbyshire on 27 Feb 2023
Answered: Fangjun Jiang on 27 Feb 2023
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.
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!