FUNCTION REFERENCE
exit
End a command-line run with an exit status.
End a command-line run with an exit status.
Syntax
exitSyntax
exit(status)Stops at once: later statements do not run and no catch handles it. Output already printed stays. The matrust process exits with status (0 when omitted), an integer from 0 to 255; any other status is an error, which exits with 1. Works in scripts, --eval, -batch and the console. Same as quit.
Differences from MATLAB: no 'force' or 'cancel' options and no finish.m. The desktop app and the browser console report that exit is not supported in this host instead of closing.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.