can anybody give me a example showing how to avoid division by 0 by using try-catch?
Show older comments
can anybody give me a example showing how to avoid division by 0 by using try-catch? thank you very much!
Accepted Answer
More Answers (1)
Walter Roberson
on 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.
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!