Time managed program in MATLAB
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
Is there any specific function or code which enables the code to run for a specified amount of time, like say, 10 minutes. The code execution is done as normal and the running of it dies after a period of time.
3 commentaires
dpb
le 1 Juil 2018
What does "it dies after a period of time" mean, precisely?
Crash, apparent idle, ... ???
Vatsal Gupta
le 1 Juil 2018
Modifié(e) : Vatsal Gupta
le 1 Juil 2018
dpb
le 1 Juil 2018
Sorry, I don't understand. Are you asking about how to stop a program after some time period, not that a program fails unexpectedly after some time?
If so, what time unit is of interest; wall clock time, CPU time (tougher all the time (so to speak :) ) any more with multi-cores, etc., etc., ), some simulation internal time, something else entirely, ...?
Réponses (1)
Walter Roberson
le 1 Juil 2018
0 votes
If you use the Parallel Computing Toolbox, then you can use parfeval() to start a process running with a "future". You can wait() for the future with a timeout. If the timeout expires, then cancel() the future.
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!