I am not getting correct graph from this code.What could be the problem
Mostrar comentarios más antiguos
I have to plot bifurcation diagram which is basically a graph.The graph which should be obtained should much resemble the following graph

Much part of the code represents the conditions for getting the values of v,that part is correct.The problem is with graph plotting of k versus v.The code is giving much incorrect graph.The code is
% code
v=zeros(31,1);
v(1)=33;
for k=0.10:0.01:0.26;
for n=1:30
d(n)=0.4717-(k*(v(n)-25));
if d(n)<0
v(n+1)=(0.8872*v(n))
else if d(n)>1
v(n+1)=(0.8872*v(n))+(((1.2*33)*(33-v(n)))/(v(n)))
else
v(n+1)=(0.8872*v(n))+((((1.2)*(33)*(33-v(n)))*(d(n)^2))/(v(n)))
end
end
end
end
k=0.10:0.01:0.26
plot(k,v(1:17))
xlabel('k')
ylabel('v')
The incorrect graph obtained from the above code is

Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


