How to set visibility of Button in SIMULINK Mask ?

36 ビュー (過去 30 日間)
Sultan
Sultan 2016 年 8 月 22 日
コメント済み: Tobias Bertsch 2023 年 8 月 25 日
I have created a "button" in a Block mask. I want to change its visibility. I have have tried set_param command with 'MaskVisibilities' but that wont work since there is no serial number against "Button". I have also tried get_param() using 'DialogParameters' but still didnt get the properties of button.

採用された回答

John D
John D 2016 年 10 月 20 日
There is a solution:
p = Simulink.Mask.get(gcb); param = p.getDialogControl(<Name of your control in the mask>); param.Visible = 'off';
  1 件のコメント
Tobias Bertsch
Tobias Bertsch 2023 年 8 月 25 日
In R2022b
param = p.getDialogControl(<Name of your control in the mask>);
did not work for me. Instead I had to use
param = p.getParameter(<Name of your control in the mask>);

サインインしてコメントする。

その他の回答 (2 件)

Fangjun Jiang
Fangjun Jiang 2016 年 8 月 22 日
Select your masked block, type "get(gcbh)" in Command window to see a full list of parameters and their values.
get/set either of this should work.
get(gcbh,'MaskVisibilities')
get(gcbh,'MaskVisibilityString')

John D
John D 2016 年 10 月 19 日
As the questioner said, "that wont work since there is no serial number" Does not work for me either.

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by