How to set visibility of Button in SIMULINK Mask ?

37 visualizaciones (últimos 30 días)
Sultan
Sultan el 22 de Ag. de 2016
Comentada: Tobias Bertsch el 25 de Ag. de 2023
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.

Respuesta aceptada

John D
John D el 20 de Oct. de 2016
There is a solution:
p = Simulink.Mask.get(gcb); param = p.getDialogControl(<Name of your control in the mask>); param.Visible = 'off';
  1 comentario
Tobias Bertsch
Tobias Bertsch el 25 de Ag. de 2023
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>);

Iniciar sesión para comentar.

Más respuestas (2)

Fangjun Jiang
Fangjun Jiang el 22 de Ag. de 2016
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 el 19 de Oct. de 2016
As the questioner said, "that wont work since there is no serial number" Does not work for me either.

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by