Wait until finish is pressed

29 ビュー (過去 30 日間)
Diana Acreala
Diana Acreala 2012 年 3 月 6 日
回答済み: Mishak Illos 2016 年 9 月 7 日
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

採用された回答

Image Analyst
Image Analyst 2012 年 3 月 6 日
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));

その他の回答 (2 件)

Mishak Illos
Mishak Illos 2016 年 9 月 7 日
This is how I created message box which allows me to end a section of code within a loop.
count = 0;
while(1)
count = count + 1;
if count ==1
h = msgbox('End Program');
end
if ishandle(h) ==0
msgbox('Program ended')
%or disp('Script ended') %..whatever...
return;
end
%Your looping program
end
I am doing image processing which requires each frame to be processed and then displayed and I didn't want to have to press ctrl-c every time I wanted to end the loop. If you have better solution please tell me .

Diana Acreala
Diana Acreala 2012 年 3 月 8 日
Hello! What I want is to use something like: uiwait(uiimport(File)) but it seems that this is getting an error.
Someone else had this problem, he found a solution but seems that the page is not available anymore..

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by