MATLAB Answers

Unable to set gain control as a variable in Simulink, setting a numeric value works OK.

조회 수: 2(최근 30일)
Marvin Colon
Marvin Colon 2021년 9월 1일
답변: Paul 2021년 9월 1일
Simulink Version 9.3 (R2019a)
I'm unable to set the Gain control as a variable. The entire Gain block turns red with an exclamation mark.
Setting the Gain as a numeric value works OK.
Thank you.


Paul 2021년 9월 1일
It turns red with the exclamation mark because you haven't defined the variable in any workspace that the model can see (typically the base or model workspace) and/or you haven't updated the model since the variable was defined. For example, if the parameter in the Gain block is 'mygain' then define it with a value in the base workspace
>> mygain = 1;
Then update the diagram.


Community Treasure Hunt

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

Start Hunting!

Translated by