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

12 vues (au cours des 30 derniers jours)
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.

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 27 Fév 2023

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by