YESNO

版本 1.0.0.0 (1.7 KB) 作者: Jos (10584)
let user choose between yes or no
2.3K 次下载
更新时间 2008/4/29

查看许可证

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

引用格式

Jos (10584) (2024). YESNO (https://www.mathworks.com/matlabcentral/fileexchange/19740-yesno), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Numeric Types 的更多信息
致谢

参考作品: getkey

启发作品: Islanding Detection In Distributed Generation

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0