필터 지우기
필터 지우기

Skip for loop iteration if it takes too long to run

조회 수: 2 (최근 30일)
Gauri Kant
Gauri Kant 2021년 6월 17일
편집: Gauri Kant 2021년 6월 18일
Hi,
I have a for loop and within that loop I have a numerical optimisation function which converges 99% of the time but in some iterations, it does not and that iteration keeps running with no termination. I want to skip an iteration which takes too long to run. For eg, move to the next iteration if the if the current iteration has already been running for 5 mins but has not yet terminated. I thought of using tic toc but that requires the numerical optimisation function to terminate in order to get the time elapsed. Any ideas as to I can solve this?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by