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