Initialise Simulink variables for one subsystem from a mask of another subsystem

조회 수: 1 (최근 30일)
I would like to have a 'Control panel' which has no connections. At the moment. I have created an empty subsystem and then created a mask for this subsystem, and added a Popup box with 3 variables, lets say, ['a' 'b' 'c']. Outside of this subsystem, ie, on the same level, I would like to be able to obtain the chosen variable and use as an input, ie a constant.
At the moment, I have named X my parameter in the mask. Then in the Initialization I have:
global const; const = X;
I then have a constant, where the value is set to const, which is connected to a display, outside of this subsystem.
However this does not work. Does anyone have any suggestions to how I can make this work?
This is a very simplified model, please don't suggest that I should use go to tags or data stores or something and replace this with the constant. This will not work.
Thanks in advance for any suggestions.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by