Program termination: Difference between revisions

MATLAB-Code added
(MATLAB-Code added)
Line 357:
</pre>
This will completely quit the kernel. All definitions will be lost. Since this terminates the actual kernel process, this will also free all resources used by that kernel (especially memory). Note however that if the kernel is interactively used through a notebook, the notebook still remains operable.
 
=={{header|MATLAB}}==
 
<lang matlab>if condition
return
end</lang>
 
There is no special way to stop a program. You can terminate it by calling <code>return</code>.
 
<lang matlab>if condition
quit
end</lang>
 
The <code>quit</code> function runs the MATLAB script <code>finish.m</code>, if it exists, and terminates MATLAB completely.
 
=={{header|Nimrod}}==
Anonymous user