How to set visibility of Button in SIMULINK Mask ?

37 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Modeling 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by