How to do a rem while loop?
4 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone. I need the h value to be an integer, I can't have decimals. Therefore, I think a while loop with the function rem is needed but I have no idea how to do it.

0 件のコメント
回答 (1 件)
Walter Roberson
2020 年 12 月 3 日
while true
h = input('Enter the desired grid spacing: ');
if isnumeric(h) && isscalar(h) && h > 0 && rem(h,1) == 0; break; end
end
0 件のコメント
参考
カテゴリ
Help Center および 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!