Question on the use of 'Return'

2 次查看(过去 30 天)
What's the difference between
try
body
catch
return
end
and
try
body
end

采纳的回答

Walter Roberson
Walter Roberson 2013-3-2
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operators and Elementary Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by