Clear Filters
Clear Filters

How to update the parameters in a mask?

6 views (last 30 days)
Willy Bernal
Willy Bernal on 13 Feb 2016
Answered: Gautam on 17 Feb 2016
I keep getting errors whenever I tried to update the parameters names of a mask for a S-function block.
I get the following error: **Invalid setting in 'vfob_lib/Generator Model' for parameter 'bg'. Caused by:
Error evaluating parameter 'bg' in 'vfob_lib/Generator Model' Caused by:
Undefined function or variable 'bg'.**
I keep getting this error when I tried to update the parameter names in Edit Mask or Look Under Mask. Either way it tells me Invalid settings.
What is the way to change the parameter names successfully?

Answers (1)

Gautam on 17 Feb 2016
Hi Willy,
A possible reason for this is that you might be creating the mask parameters(for example, the parameter 'bg') for your S-Function in an incorrect manner. Please follow the steps mentioned below:
  1. Once your S-Function is added into the model, right click on it and choose 'Mask' and then 'Create Mask...' option. This opens up the Mask Editor for the S-Function block.
  2. Here,add the parameters by clicking on 'Parameters' in the Dialog Box of the Mask Editor and then 'Edit' option in the Controls tab of the Mask Editor. This displays a new field on the Dialog Box.
  3. Give the name for the 'Prompt' (as you want it to be displayed on your S-Function mask dialog) and also the 'Name' of the parameter. Click on 'Apply' and then 'OK'. If you double click on your S-Function now, you can see the masked S-Function and also the added parameter(for example, 'bg').
  4. Right click on the S-Function block, choose 'Mask' and then 'Look under Mask' option. Here, specify the parameter 'Name' and NOT the 'Prompt' label(refer previous point). Click 'Apply' and then 'OK'
If you have more than one parameters, they can be added to the Mask in a similar manner. Note that you will have to configure the script defining your S-Function appropriately to accommodate additional mask parameters.
Hope this helps.


Find more on Author Block Masks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!