variable sweep in simulink

11 Ansichten (letzte 30 Tage)
nadav yanay
nadav yanay am 13 Nov. 2011
How do I sweep the value of a "gain block" in simulink? can I do a few iterations, each one with different value in the gain block? Thanks
  1 Kommentar
Marsia Hossen Konika
Marsia Hossen Konika am 5 Jul. 2021
Hi!
How do sweep current and voltage in a simulink model?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Thijs
Thijs am 13 Nov. 2011
in simulimnk change the name of the gain parameter to for example G. The value for G can then be specified from the workspace. So you can use a for loop like this one:
gain=[1:20];
for n=1:length(gain)
G=gain(n);
run('simulink_model_name')
end
using parfor instead of for can improve performance if you have a multiple core machine.
hope this helps
  1 Kommentar
Rahul Kumar
Rahul Kumar am 15 Mai 2019
Update: If you are using R2017a or later, the parsim command can be used to set this up very easily.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by