Filter löschen
Filter löschen

How to Create Infinite For Loops MATLAB

43 Ansichten (letzte 30 Tage)
Sabri Çetin
Sabri Çetin am 22 Jun. 2016
Kommentiert: Abdulrahman Saad am 10 Okt. 2019
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 Kommentare
KSSV
KSSV am 22 Jun. 2016
What do you mean by infinite?
Sabri Çetin
Sabri Çetin am 22 Jun. 2016
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

cbrysch
cbrysch am 22 Jun. 2016
for k=1:inf
disp(k)
end

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by