I have a problem using the uialert/uiconfirm functionality.
The short version of my question is: is there a way to find uialert/uiconfirm windows/boxes and close them programmatically if they are no longer required? I don't want to close the underlying uifigure.
The long version:
I'm currently working on a program with a GUI (using the new appdesigner/ uifigure utilities) in order to control an instrument. The setup is as following:
The instrument takes commands through the serial interface from the matlab program and executes them. The instrument has 2 buttons: one which allows to user to stop the instrument in case of an emergency and another to continue the operation. When one of these buttons is pushed the instrument state flag changes (Hold = on/off);
The program on the other side sends commands to the instrument depending on the user input. Before sending a new command, it querries the instrument state flag in order to determine whether the istrument state is Hold = off and ready to execute the next command. In case the flag changed to Hold = on, the program uses the uialert/uiconfirm functionality to notify the user and block additional input through the gui.
Once the Hold = on flag was triggered, there are two ways to disable it; eigther by pressing the instrument button or using the uialert/uiconfirm option button. If the user desides to press the instrument button, which I can monitor using a timer function querring the instrument state flag, I have the uialert window to be removed. Unfortunatly these functions do not return a handle or any other identification property which I could use to close the alert window. Do you have any idea how to work around this problem?
Thank you for your time and help in advance!