Code covered by the BSD License  

Highlights from

5.0 | 2 ratings Rate this file 8 Downloads (last 30 days) File Size: 1.65 KB File ID: #19740 Version: 1.0



Jos (10584) (view profile)


28 Apr 2008 (Updated )

let user choose between yes or no

| Watch this File

File Information

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.
    fprintf('\nHere is a number for you: %5.0f', 1000*rand)
        fprintf('\nDo you want another number (y/n)? ') ;
        if yesno, fprintf(' %5.0f', 1000*rand) ;
        else fprintf('\nBye!\n') ;

version 1.0 april 2008


Getkey inspired this file.

MATLAB release MATLAB 6.5 (R13)
Other requirements should work on most ML releases
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
20 Dec 2008 alain boyer  
20 Dec 2008 V. Poor  

Contact us