필터 지우기
필터 지우기

How to set visibility of Button in SIMULINK Mask ?

조회 수: 37 (최근 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 CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by