MATLAB: Does the initialization function in a Simulink subsystem block use an integer rather than the corresponding text string

initializationmasksimulinksubsystem

There is an example Simulink file attached. I created a parameter on the "Parameter & Dialog" tab called Parameter1. Parameter1 is a popup and has 3 possible values Option 1, Option 2, and Option 3 as shown below.
&nbsp
If I query Parameter1 from the command line get_param(gcb, 'Parameter1'), I find the value to be one of the three options listed (see picture). However, if I use Parameter1 as a variable in the Initialization tab, it acts like integer (see 2nd picture below). I understand that Simulink is really using Enumeration. Is there a way I can use/invoke this Enumeration in the initialization of my subsystem?
&nbsp

Best Answer

To use the text string coming from the popup options, turn off the "evaluate" checkbox as shown below. This allows comparison of text in the option in the initialization. There is code snippet below
if strcmpi(Parameter1, 'option 1')
% Do this
else
% Do something else
end
The above code snippet only works if "Evaluate" checkbox is unchecked. Otherwise in the initialization, Parameter1 is an integer corresponding to which option was selected in the popup of Parameter1. For instance with the "Evaluate" checkbox checked, if the first option in the popup was selected, Parameter1 is 1 and if the second option was selected, then Parameter1 is 2.