图形的方法 ATLAB f=inline(1/x(X-1) ezplot(f,0, 4) phi= fzero(f,1) hold on plot(phi, 0, 0)
图形的方法 f = inline('1/x-(x-1)') ezplot(f,0,4) phi = fzero(f,1) hold on plot(phi,0,’o’)
结果图 x-(x-1) 6 2 0 2.5 3.5
0 0.5 1 1.5 2 2.5 3 3.5 4 -3 -2 -1 0 1 2 3 4 5 6 7 x 1/x-(x-1) 结果图
黄金分割图
- 1 1 1 黄金分割图
%GOLDRECT Golden rectangle GOLDRECt plots the golden rectangle phi=(1+sqrt(5)/2; x=[0 phi phil 0] y=[00110];u=[11];v=[01 plot(x,y, b, u,v, b--); text(phi/2, 1.05, phi) text(1+phi)/2,-05,phi-1); text(-.05,5,"1);text(5,-05,1) axis equa aXIs o f set(gcf, color, white,)
%GOLDRECT Golden Rectangle % GOLDRECT plots the golden rectangle phi = (1+sqrt(5))/2; x = [0 phi phi 0 0]; y = [0 0 1 1 0]; u = [1 1]; v = [0 1]; plot(x,y,'b',u,v,'b--'); text(phi/2,1.05,'\phi') text((1+phi)/2,-.05,'\phi - 1'); text(-.05,.5,'1'); text(.5,-.05,'1') axis equal axis off set(gcf,'color','white')
连分式 a H =1+ l
连分式 ... 1 1 1 3 2 1 0 + + + + a a a a 1 ... 1 1 1 1 1 1 + + + = +