can anybody give me a example showing how to avoid division by 0 by using try-catch?
Ältere Kommentare anzeigen
can anybody give me a example showing how to avoid division by 0 by using try-catch? thank you very much!
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 7 Okt. 2011
1 Stimme
Don't do that. Do like I recommended earlier: calculate the denominator and assign the result to a variable, and test the range of the variable, and take appropriate corrective action if it is smaller than you want.
Kategorien
Mehr zu Error Handling finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!