can anybody give me a example showing how to avoid division by 0 by using try-catch?
Mostrar comentarios más antiguos
can anybody give me a example showing how to avoid division by 0 by using try-catch? thank you very much!
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 7 de Oct. de 2011
1 voto
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.
Categorías
Más información sobre Error Handling en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!