while loop and nan causing inifinite loop
Mostra commenti meno recenti
I have the following code

now what happens when i run this is that the while loop doesn't ever stop and op ends up equal to (NaN NaN). i'm not exactly sure what's wrong.
i figured that i could simply try to exit the while loop if the value was nan by sayign that if np(1) or np(2) was equal to nan than np(1) would equal fp(1) and the while loop would stop, but i can't seem to do that either... could anyoen help me?
Risposta accettata
Più risposte (1)
Matt J
il 9 Gen 2013
Use the dbstop command
>>dbstop if naninf
to detect where the NaNs are introduced.
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!