can anybody give me a example showing how to avoid division by 0 by using try-catch?
Afficher commentaires plus anciens
can anybody give me a example showing how to avoid division by 0 by using try-catch? thank you very much!
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 7 Oct 2011
1 vote
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.
Catégories
En savoir plus sur Error Handling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!