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!