MATLAB: Wait until finish is pressed

guiMATLAB

Hello!
I am using this command uiimport(FileName); for importing some parameters in workspace. After importing these parameters I get an error msg in case my parameters are not named properly.
My problem is that this msg appears at the same time with the uiimport window. Normally my msg has to wait until the FINISH button from the uiimport window is pressed.
How can I do this? To wait until this finish button is pressed..
Thanks! Diana

Best Answer

Wrap it in uiwait:
uiwait(msgbox('This message will pause execution until you click OK'));
You can make up a string with other strings and numbers in it if you want:
message = sprintf('The value is %d.\nClick OK to continue.', myNumber);
uiwait(msgbox(message));