Filter löschen
Filter löschen

Question on the use of 'Return'

2 Ansichten (letzte 30 Tage)
QiQin Zhan
QiQin Zhan am 2 Mär. 2013
What's the difference between
try
body
catch
return
end
and
try
body
end

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Mär. 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.

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by