How to plot the discrte form of the logistic model in matlab -


i want plot y(k) againts k of following formula in matlab:

             y(k+1)=r(y(k))(1-y(k)) 

so did following:

%logistic model in discrete form. r=2.5; y=rand(1); j=1:100         y(j+1)=r*y(j)*(1-y(j));  end plot(y(j+1),j) 

but when run it, thing gives me white plot, is, axis. did wrong here?, can me fix it?

thanks lot in advance.

you need create array of values of function.

%logistic model in discrete form. r=2.5; y = zeros(100, 1); y(1) = rand(1); j=1:100     y(j+1)=r*y(j)*(1-y(j)); end plot(1:101, y) 

plot function 2 arrays, first values of x axis, second values of y axis.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -