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

Marsia Hossen Konika
Marsia Hossen Konika 2021년 7월 5일
Hi!
How do sweep current and voltage in a simulink model?

댓글을 달려면 로그인하십시오.

 채택된 답변

Thijs
Thijs 2011년 11월 13일

2 개 추천

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

Rahul Kumar
Rahul Kumar 2019년 5월 15일
Update: If you are using R2017a or later, the parsim command can be used to set this up very easily.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 General Applications에 대해 자세히 알아보기

제품

태그

질문:

2011년 11월 13일

댓글:

2021년 7월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by