Making a function produce a specific error?
Show older comments
I have a certain function that I created and I need it to produce a certain error when a certain condition is satisfied. For example:
if x > a(1)
error('Error using function y')
end
However, for some reason, when I run the function, the condition is not checked and instead the function computes an output though the condition for the if statement should have been satisfied.
Accepted Answer
More Answers (0)
Categories
Find more on Programming 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!