Question on the use of 'Return'

조회 수: 1 (최근 30일)
QiQin Zhan
QiQin Zhan 2013년 3월 2일
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에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by