Filter löschen
Filter löschen

After running a script i got answer in command window, now how can i run it again from command window?

2 Ansichten (letzte 30 Tage)
I want to write a program so that after running it give desired output of some algorithm and display result in command window. and then ask **'do you want to run again Y/N'****. if i select Y it execute the program again. and if 'N' is selected it will not do any thing.
how i solve this because in C-programming we have do-while loop which i find easy. But here i can't find such.
plz help with code. and sufficient description.

Akzeptierte Antwort

Image Analyst
Image Analyst am 4 Mär. 2013
Here's one way:
button = 'Continue';
while strcmpi(button, 'Continue')
promptMessage = sprintf('Do you want to Continue processing,\nor Cancel to abort processing?');
titleBarCaption = 'Continue?';
button = questdlg(promptMessage, titleBarCaption, 'Continue', 'Cancel', 'Continue');
if strcmpi(button, 'Cancel')
break;
end
end

Weitere Antworten (0)

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by