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

조회 수: 3 (최근 30일)
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.

답변 (1개)

Paul
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.

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by