Programming Previous page   Next Page

Program Termination -- return

Program termination control enables you to exit from your program at some point prior to its normal termination point.

return

After a MATLAB function runs to completion, it terminates and returns control either to the function that called it, or to the keyboard. If you need to exit a function prior to the point of normal completion, you can force an early termination using the return function. return immediately terminates the current sequence of commands and exits the currently running function.

return is also used to terminate keyboard mode.


Previous page  Error Control -- try, catch Symbol Reference Next page

© 1994-2005 The MathWorks, Inc.