File Exchange

image thumbnail

YESNO

version 1.0 (1.65 KB) by

let user choose between yes or no

0 Downloads

Updated

View License

YESNO - returns true for y-key, false for n-key

ISYES = YESNO waits for a keypress of either the Y-key or N-key and returns a logical one (true) if the Y-key was pressed, and a logical zero (false) if the N-key was pressed.

Example:
fprintf('\nHere is a number for you: %5.0f', 1000*rand)
while(1)
fprintf('\nDo you want another number (y/n)? ') ;
if yesno, fprintf(' %5.0f', 1000*rand) ;
else fprintf('\nBye!\n') ;
break
end
end

version 1.0 april 2008

Comments and Ratings (2)

alain boyer

V. Poor

MATLAB Release
MATLAB 6.5 (R13)
Acknowledgements

Inspired by: getkey

Inspired: Islanding Detection In Distributed Generation

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video