I am working on this problem x(i+1)=rx(1-x) where the question says plot x as a function of r for 1<r<4.
Here is what I did:
r=1:0.01:4;x=[];x=0.35;N=100;for i=1:N;x(i+1)=r*x(i)*(1-x(i));end
but then this error message comes up. What's wrong with this code? How can I improve it?
Best Answer