Jump to content

Handle a signal: Difference between revisions

m
MATLAB: Fixed works with templates
(Added MATLAB examples)
m (MATLAB: Fixed works with templates)
Line 533:
=={{header|MATLAB}}==
MATLAB versions 6.5 (R13) and newer can no longer catch CTRL+C with a try-catch block. The onCleanup() function was introduced in version 7.6 (R2008a), possibly specifically for this situation. However, the designated onCleanup() function will execute no matter how the function ends (task completion, CTRL+C, exception), and CTRL+C will still cause an exception to be thrown and displayed.
{{works with|MATLAB|Version 7.6 (R2008a) and later}}
<lang MATLAB>function sigintHandle
k = 1;
Line 554:
Elapsed time is 3.348772 seconds.
??? Operation terminated by user during ==> sigintHandle at 6</pre>
{{works with|MATLAB|Version 6.1 (R12.1) and earlier}}
{{untested|MATLAB}}
<lang MATLAB>function sigintHandle
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.