I am not getting correct graph from this code.What could be the problem
显示 更早的评论
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

采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


