Azzera filtri
Azzera filtri

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

2 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Image Analyst
Image Analyst il 4 Mar 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

Più risposte (0)

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by