Error in limiting user input to only numeric values?
古いコメントを表示
Here is my code:
b = input('Enter the number of degrees celcius: ','s');
str2double(b);
while (isnumeric(b) == false)
disp(error_3)
b = input('Enter the number of degrees celcius: ','s');
str2double(b);
end
I'm running into an error where it doesn't update b and check it again on each run of the while loop? How can I fix this?
採用された回答
その他の回答 (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!