Terminate a dead loop or a function automatically in Matlab

Terminate a dead loop or a function automatically in Matlab

Sie verfolgen jetzt diese Einreichung

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.

Zitieren als

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

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und MATLAB Answers

Allgemeine Informationen

Kompatibilität der MATLAB-Version

  • Kompatibel mit allen Versionen

Plattform-Kompatibilität

  • Windows
  • macOS
  • Linux
Version Veröffentlicht Versionshinweise Action
1.0.0.0