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에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


