Search code examples
stringmatlabblocksimulinks-function

Masking Simulink blocks: how to interpret mask parameter as string?


when I'm masking a block (in this case putting a mask on an sfunction) I want one of the parameters to be treated as a literal string. I know to use 'unit8(sParameter1)' but I can't figure out how to change that line to make it a string.

And I want to use that string to be displayed as part of the block name, again I know where(in the mask using the "icon drawing commands" prompt) but not how


Solution

  • If you look at the attributes of each parameter defined in a mask (for example see the Dialog Box section of the Mask Editor Overview doc) then you'll see that a parameter can be specified as being "Evaluate" (or not).

    This tells Simulink whether what you enter in the dialog should be treated as a literal string or whether it should be evaluated in MATLAB to get an actual value