Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Time managed program in MATLAB
조회 수: 1 (최근 30일)
이전 댓글 표시
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
dpb
2018년 7월 1일
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, ...?
답변 (1개)
Walter Roberson
2018년 7월 1일
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.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!