How to run a loop with isNaN
이전 댓글 표시
How would i make a loop where if a positive number isnt inputted, The question is asked again?
댓글 수: 4
Jan
2022년 10월 17일
This sounds like a homework assignment. What have you tried so far? Which explicit problem to you have?
Davide Masiello
2022년 10월 17일
편집: Davide Masiello
2022년 10월 17일
Your code seems fine, just remove the line
a =~ NaN;
and it works, meaning that if you input a = nan then it'll display the 'Please only enter a numerical value for a: ' message.
Benjamin
2022년 10월 17일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!