필터 지우기
필터 지우기

How to Create Infinite For Loops MATLAB

조회 수: 45 (최근 30일)
Sabri Çetin
Sabri Çetin 2016년 6월 22일
댓글: Abdulrahman Saad 2019년 10월 10일
In matlab, is there a way of creating infitine for loops?
Also creating an infinite vector would be sufficient I guess, is that possible?
I tried the following buy I do NOT recommend doing this;
i = 1 ;
while ( i )
v(i) = i ;
i = i + 1 ;
end
This caused an error in my computer, is there any other trial? Any answer is appreciated.
  댓글 수: 2
KSSV
KSSV 2016년 6월 22일
What do you mean by infinite?
Sabri Çetin
Sabri Çetin 2016년 6월 22일
We can characterize it from my point of view as the following.
The program including a loop runs properly(no error), but no command after the loop can be executed.
The program enters the loop body and it cannot leaves the loop body. The execution never ends, that is what I mean.

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

채택된 답변

cbrysch
cbrysch 2016년 6월 22일
for k=1:inf
disp(k)
end

추가 답변 (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