0

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

Phil Goddard
  • 10,571
  • 1
  • 16
  • 28
  • Are you looking for something other than just putting a single quote before and after the characters (i.e. the usual way of creating a string in MATLAB)? – Phil Goddard Apr 06 '16 at 03:13
  • I'm talking about the parameters I define in the Block properties, not about parameters being defined in *.c or *. m file. when I set the value of the parameter inside the mask it shows them accordingly in the mask but intern its always 1,2,3... counting up with number of values I create for that parameter. but I want the value to be the actual string not a number – gozilla1988 Apr 06 '16 at 11:41
  • For me, your question is still very unclear. "Intern" (do you mean internal?) to what? What do you mean by "counting up with numbers ... for that parameter"? Counting where? Are you talking about the ordinal index of the parameter in the list of parameters? – Phil Goddard Apr 06 '16 at 16:23
  • 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](https://www.mathworks.com/help/simulink/gui/mask-editor-overview.html) 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. Is this what you're asking? – Phil Goddard Apr 06 '16 at 16:30
  • thank you! evaluate was the thing i didn't know about – gozilla1988 Apr 06 '16 at 22:22

1 Answers1

3

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

Phil Goddard
  • 10,571
  • 1
  • 16
  • 28