Running simulation in a loop

2 views (last 30 days)
Reece Dawkins
Reece Dawkins on 24 Apr 2016
Answered: ag on 23 Apr 2025
I have designed a model which I want to simulate in a loop to plot graphs for iterations changing one variable per interation.
The Model is of a Solar Array system, I wish to plot the characteristic curves from multiple irradiance on one graph, or running the simulations individual storing the data which can then be plotted on the same axis.

Answers (1)

ag
ag on 23 Apr 2025
Hi Reece,
I kindly suggest you to refer to my answer on the following MATLAB answers post to understand how to simulate a model in a loop using MATLAB: https://www.mathworks.com/matlabcentral/answers/1642620-looping-and-storing-variable-to-be-used-in-simulink-model#answer_1564005?s_tid=prof_contriblnk
To store the obtained results upon simulation, you may use the "To Workspace" block in simulink and utilise the same to plot the results as per the need.
For more details on "To Workspace" block, please refer to the following MathWorks documentation: https://www.mathworks.com/help/simulink/slref/toworkspace.html
Hope this helps!

Categories

Find more on Solar Power 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!