- 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.
- 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.
- 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').
- 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'
How to update the parameters in a mask?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (1)
Gautam
el 17 de Feb. de 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:
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.
0 comentarios
Ver también
Categorías
Más información sobre Block and Blockset Authoring en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!