How to run a loop with isNaN
Mostra commenti meno recenti
How would i make a loop where if a positive number isnt inputted, The question is asked again?
4 Commenti
Jan
il 17 Ott 2022
This sounds like a homework assignment. What have you tried so far? Which explicit problem to you have?
Davide Masiello
il 17 Ott 2022
Modificato: Davide Masiello
il 17 Ott 2022
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
il 17 Ott 2022
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!