While Loop Question - Will not Properly Execute
古いコメントを表示
% Until good gender, prompt user to enter the gender
y = input ( 'Is the person female(1) or male(2)? Enter 1 or 2: ' );
while (y ~= 1) || (y ~= 2)
disp( 'not 1 or 2' )
y = input ( 'Is the person female(1) or male(2)? Enter 1 or 2: ' );
end
Can anyone tell me why this will not properly execute when ran through MATLAB?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!