aa=[1:0.02:2.5,2.505:0.005:3.5,3.501:0.001:4]%节约计算,变变渣尘陪长
n=200
plotn=5
savex=[]
for a=aa
x=0.5
for i=2:n
x(i)=a*x(i-1)*(1-x(i-1))
end
savex=[savexx((n-plotn+1):n)]
end
plot(aa,savex,'.')
% 初值及参数rx0 = rand
y0 = rand
r = rand
% 迭代次数
N = 100
% 主程序
x = zeros(N,1)*NaN
y = x
x(1) = x0
y(1) = y0
for n = 1:N-1
x(n+1) 搏兆= r * x(n)*(1-y(n))
y(n+1) = x(n)
plot(x,y)
圆慧 基腔租drawnow
end
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)