I want to open figure only when user dialog of mask is open
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a mask with a user dialog. I have a few issues with a figure at this dialog:
1) If the dialogue is open then the function "opening_diagram_callback" should be open and if the user changes anything, this figure should be updatet.
2) If the user closes the user dialog the figure should be also closed automatically.
3) If the simulation is started the figure shouldn't appear.
At first I tried it to put the "opening_diagram_callback" function in the init function. But then the second point isn't possible and it also appears during simulation because there it also runs through the init function.
Can someone please help me with this problem??
3 Kommentare
Antworten (1)
Jaimin
am 4 Dez. 2024
Hi @Bernhard
To address your issues with the dialog and figure management in Simulink, consider the following two resources that might help you find a solution:
- Initialize Mask – Simulink (https://www.mathworks.com/help/simulink/ug/initialize-mask.html): This documentation provides detailed information on how to initialize masks in Simulink. It explains how to use initialization commands to manage callbacks like “opening_diagram_callback”, ensuring that figures are correctly updated and managed based on user interactions.
- Author Mask Init Callback – Simulink (https://www.mathworks.com/help/simulink/ug/author-mask-init-callback.html): This guide offers insights into authoring mask initialization callbacks in Simulink. It includes instructions on implementing callbacks that can help manage the opening and closing of figures in response to dialog events, without interfering with simulations.
To prevent the image from displaying during simulation, utilize the “SimulationStatus” property of “bdroot”.
Kindly refer following code snippet for understanding.
isSimulating = strcmp(get_param(bdroot, 'SimulationStatus'), 'running');
I hope this will be helpful.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!