MATLAB Answers

Run a simulation repeatedly for certain times..

3 views (last 30 days)
FG on 11 Mar 2020
Commented: FG on 11 Mar 2020
Hi all.. I want to run a simulation repeatedly for certain times with different parameters at each. I have a code as an m file and I can share. Can anyone help me about that ?

Answers (1)

Ameer Hamza
Ameer Hamza on 11 Mar 2020
This link shows the MATLAB's build-in features to run several simulations: If you have parallel computing toolbox, then they can run in parallel. However, the setup can be a bit involved, check here for example:
If you want a simple solution, you can write a for loop and use sim function to run several simulations
for i=1:10
% change parameters
model_name.slx is the same of the simulink model.
FG on 11 Mar 2020
Thnx friend.. I'll let you know when I get it done : )

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!