- 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 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Gautam
2016 年 2 月 17 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Block and Blockset Authoring についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!