YESNO

let user choose between yes or no

現在この提出コンテンツをフォロー中です。

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) (2026). YESNO (https://jp.mathworks.com/matlabcentral/fileexchange/19740-yesno), MATLAB Central File Exchange. に取得済み.

謝辞

ヒントを得たファイル: getkey

ヒントを与えたファイル: Islanding Detection In Distributed Generation

カテゴリ

Help Center および MATLAB AnswersNumeric Types についてさらに検索

一般的な情報

MATLAB リリースの互換性

  • すべてのリリースと互換性あり

プラットフォームの互換性

  • Windows
  • macOS
  • Linux
バージョン 公開済み リリース ノート Action
1.0.0.0