a(1)=0.1, a(2)= 0.11; for k=2:10^10 a(k+1)= a(k)+a(k-1)+..... if a(k+1)> 5.0Up = k ;end end. It takes a lot of memory as iteration number is very high. How can I update the initial value like a(3)=a(2); a(1)=a(2) and find new a(3) till my condition is satisfied.
MATLAB: How to update initial value of an array in a for loop
update initial value in a loop
Best Answer