Simulink Quick Insert - Setting a specific block parameters

4 ビュー (過去 30 日間)
Scott
Scott 2022 年 11 月 29 日
回答済み: Anshuman 2023 年 3 月 21 日
When using the Simulink Quick Insert for a block (click on workspace, type the block name) certain blocks will pop up a text entry field to allow a specific parameter to be edited. For example the Gain block will allow you to get the gain parameter.
For custom blocks, is there a way to specify which parameter is available to the user to edit? So if a block has two mask parameters, it will allow editing of parameter 2 rather than parameter 1?
Also is there a way to disable this text entry field for blocks?

採用された回答

Anshuman
Anshuman 2023 年 3 月 21 日
Hi Scott,
Yes, you can specify which parameter is available to the user to edit for custom blocks by creating a mask for your block. To create a mask for your block,:
  1. Firstly open your custom block in Simulink.
  2. From the block's context menu, select Mask > Create Mask. This opens the Mask Editor.
  3. In the Mask Editor, you can add mask parameters by clicking the Add button in the Parameters tab. You can then set the parameter properties, including the prompt string, data type, and default value.
  4. To make a parameter editable in the block's Quick Insert dialog, you need to set its Prompt field to a non-empty string. This will enable users to enter a value for that parameter in the Quick Insert dialog.
To disable the text entry field for a block, you can remove the prompt string for all mask parameters in the Mask Editor. Alternatively, you can set the Block Properties > Mask > Mask Display > Show Parameter Dialog During Simulation option to "off" to prevent the mask dialog from appearing during simulation. Note that this will also prevent users from setting parameter values using the mask dialog during simulation.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Model Editing についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by