How to stop a matlab process, if it exceeds certain time threshold?
Mostrar comentarios más antiguos
I'm executing a function f1(), and simulation time for function f1() can be high or low depending upon many random parameters. So I want to kill the process f1(), if it takes more than 1 hour simulation time.
So my code should look something like this,
f1();
wait 1 hour
if f1() still running
Kill process f1();
end
Is there any way to implement this in matlab? I know I can spawn a process using system command, but I'm trying to find a way to do this without invoking system command, since the inputs to the function f1() are too big and comlpicated.
Respuesta aceptada
Más respuestas (2)
Anver Hisham
el 18 de Mayo de 2017
0 votos
1 comentario
Walter Roberson
el 18 de Mayo de 2017
(I note the above will not work on MS Windows. Possibly it might work on OS-X, but it looks like it was written for Linux)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!