Skip to Main Content Skip to Search
Product Documentation

return - Return to invoking function

Syntax

return

Description

return causes a normal return to the invoking function or to the keyboard. It also terminates keyboard mode.

Examples

This determinant function uses return to handle the special case of an empty matrix:

function d = det(A)
%DET det(A) is the determinant of A.
if isempty(A)
    d = 1;
    return
else
    ...
end

See Also

break | continue | disp | end | error | for | if | keyboard | switch | while

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS