Prev: integration
Next: newff neural network
From: lesego Nnyaya on 4 May 2010 13:53 I was wondering if there's anyone out there who can help me with this problem. I have a simple script that I use to clean my workspace as follows: clc d=input('close figures? (y/n) ','s'); if d=='y' close all elseif d=='n' display('no figures deleted'); else error('enter proper flag'); end clear Now I want to delay the effect of the last command "clear", so that if any person uses this script other than me can be able to see the text "no figures deleted" if "n" is chosen. As it is now, everything disappears in the blink of an eye. Any suggestions? Thank you.
From: checker i on 4 May 2010 14:00 "lesego Nnyaya" <nnyaya(a)hotmail.com> wrote in message <hrpmu0$pdh$1(a)fred.mathworks.com>... > I was wondering if there's anyone out there who can help me with this problem. I have a simple script that I use to clean my workspace as follows: > > clc > d=input('close figures? (y/n) ','s'); > if d=='y' > close all > elseif d=='n' > display('no figures deleted'); > else > error('enter proper flag'); > end > clear > > Now I want to delay the effect of the last command "clear", so that if any person uses this script other than me can be able to see the text "no figures deleted" if "n" is chosen. As it is now, everything disappears in the blink of an eye. Any suggestions? > > Thank you. have you tried 'pause' command?
From: Jan Simon on 4 May 2010 14:43 Dear lesego! > clc > d=input('close figures? (y/n) ','s'); > if d=='y' > close all > elseif d=='n' > display('no figures deleted'); > else > error('enter proper flag'); > end > clear > > Now I want to delay the effect of the last command "clear", so that if any person uses this script other than me can be able to see the text "no figures deleted" if "n" is chosen. As it is now, everything disappears in the blink of an eye. Any suggestions? If I choose 'n' in your script, I can see "no figures deleted". Nothing disappears on the display of my computer after a CLEAR command. CLEAR clears just the variables and functions from the workspace, but it does not celar the screen as your initial CLC command. Kind regards, Jan
From: lesego Nnyaya on 4 May 2010 14:50 "checker i" <checker.im(a)gmail.com> wrote in message <hrpnbn$nng$1(a)fred.mathworks.com>... > "lesego Nnyaya" <nnyaya(a)hotmail.com> wrote in message <hrpmu0$pdh$1(a)fred.mathworks.com>... > have you tried 'pause' command? thanks a lot for your quick response. 'pause' indeed is one of the options i could use, but like the name says it pauses execution of a script or function until the user intervenes by hitting the enter button. in my case, i do not want the user to do that, because then i'd have to let the user know that he has to press that key. i'm just looking for a way to do the countdown, say from 3s to 0s, until 'clear' command is executed.
From: lesego Nnyaya on 4 May 2010 14:57
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hrppro$a19$1(a)fred.mathworks.com>... > Dear lesego! > > > clc > > d=input('close figures? (y/n) ','s'); > > if d=='y' > > close all > > elseif d=='n' > > display('no figures deleted'); > > else > > error('enter proper flag'); > > end > > clear > > > > Now I want to delay the effect of the last command "clear", so that if any person uses this script other than me can be able to see the text "no figures deleted" if "n" is chosen. As it is now, everything disappears in the blink of an eye. Any suggestions? > > If I choose 'n' in your script, I can see "no figures deleted". Nothing disappears on the display of my computer after a CLEAR command. CLEAR clears just the variables and functions from the workspace, but it does not celar the screen as your initial CLC command. > > Kind regards, Jan Thanks pointing that out Jan. in fact, i copied and pasted the script i was still working on. the original one had 'clear' at the top and 'clc' at the very bottom. sorry for the confusion. |