I am trying to run a nested loop to get three values saved as 3d matrix and then get a 3d plot from them. How can I do this. The values come from Xi+1 = r*Xi(1 − Xi), where i range from 1:50 and r from 2.4 to 4.
###Code####r=2.4:0.1:4;for j=1:16; X(1,1)=.5; xsav(1,1)=1; xsav(1,2)=X(1); r(j)=2.4+j*.1; for i=1:50; X(i+1)=r(j)*X(i)*(1-X(i)); endend
How do I save these values and plot a 3d. (mesh or plot3 or comet3)
Best Answer