필터 지우기
필터 지우기

Exit infinite loop in script via expression

조회 수: 1 (최근 30일)
Jon
Jon 2014년 4월 23일
댓글: Jan 2014년 4월 23일
Hi, is there a way to basically detect an infinite loop and stop it within a script programmatically? Let's say you had a vector, an a while loop which with a function puts a random number in the vector if there's space i.e. m(x, y) == 0. With the condition of the while loop being:
while (m(rrn, rcn) ~= 0)
where 'm' is the vector, 'rrn' is the 'random row number' etc.
  댓글 수: 1
Jan
Jan 2014년 4월 23일
The example is not clear to me. Why is this an infinite loop? As long as this is not clear, detecting such cases programmatically is impossible.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by