Question on the use of 'Return'

1 vue (au cours des 30 derniers jours)
QiQin Zhan
QiQin Zhan le 2 Mar 2013
What's the difference between
try
body
catch
return
end
and
try
body
end

Réponse acceptée

Walter Roberson
Walter Roberson le 2 Mar 2013
try/catch followed by return has the effect of returning to the calling routine when an error is detected, without executing any following code. try with no catch, or try/catch that does not have a return (or exit or quit or error()) in the catch, continues executing after the try/end even if an error occurred.

Plus de réponses (0)

Catégories

En savoir plus sur Operators and Elementary Operations dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by