File Exchange

image thumbnail

Terminate a dead loop or a function automatically in Matlab

version 1.0.0.0 (1.72 KB) by Zheng
Terminate a dead loop or a function automatically in Matlab

0 Downloads

Updated 08 Aug 2017

View License

This example shows the process to terminate a dead loop or a function automatically.
The idea is to check the Process ID of the running matlab in windows. When the time for running some functions takes too long a time, then kill the job by DOS

command: taskkill -f /pid PID

The command to get the PID of the running job can be obtanied by DOS command: System.Diagnostics.Process.GetProcessesByName.

The main control subroutine is main_control.m; and dummy_dead_loop.m is to simulate the dead endless loop or a function.

Cite As

Zheng (2019). Terminate a dead loop or a function automatically in Matlab (https://www.mathworks.com/matlabcentral/fileexchange/64045-terminate-a-dead-loop-or-a-function-automatically-in-matlab), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

matlab_kill_jobs/