上海复旦大学matlab课件ppt.ppt
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《上海复旦大学matlab课件ppt.ppt》由会员分享,可在线阅读,更多相关《上海复旦大学matlab课件ppt.ppt(59页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Matlab MathCleve Morler著陈文斌()复旦大学2002年http:/www.stanford.edu/class/cs138/mlmath.html黄金分割 p=1 1 1;r=roots(p);r=-0.61803398874989 1.61803398874989 C(1)*XN+.+C(N)*X+C(N+1)=0 r=solve(1/x=x-1);r=1/2*5(1/2)+1/2 1/2-1/2*5(1/2)符号工具箱MappleMapple phi=r(1)vpa(phi,50)1/2*5(1/2)+1/21.6180339887498948482045868343
2、656381177203091798058 phi=double(phi)1.61803398874989图形的方法 f=inline(1/x-(x-1)ezplot(f,0,4)phi=fzero(f,1)hold on plot(phi,0,o)00.511.522.533.54-3-2-101234567x1/x-(x-1)结果图 ff-111黄金分割图%GOLDRECT Golden Rectangle%GOLDRECT plots the golden rectanglephi=(1+sqrt(5)/2;x=0 phi phi 0 0;y=0 0 1 1 0;u=1 1;v=0 1;
3、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 equalaxis offset(gcf,color,white)连分式连分式Goldfract.mg=1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1)g=21/13g=1.61538461538462err=0.0026字符串有效数字2位Fibonacci Leonardo Pisano Fibonacci was born around 1170 and died aroun
4、d 1250 in Pisa in what is now Italy.He traveled extensively in Europe and Northern Africa.He wrote several mathematical texts that,among other things,introduced Europe to the Hindu-Arabic notation for numbers.Even though his books had to be transcribed by hand,they were still widely circulated.In hi
5、s best known book,Liber Abaci,published in 1202,he posed the following problem.A man put a pair of rabbits in a place surrounded on all sides by awall.How many pairs of rabbits can be produced from that pair in ayear if it is supposed that every month each pair begets a new pairwhich from the second
6、 month on becomes productive?兔子的故事兔子从出生要一个月,从出生到成熟要过一个月 月123456繁殖111235出生011235成熟001123总数1235813Fibonacci序列Fibonacci.m123581321345589144 233递归实现:Fibnum.m递归实现递归实现是elegant but expensive tic,fibnum(24),toc tic,fibonacci(24),toc试一下,比较时间!黄金分割和Fibonacci数比较一下goldfract(6)和fibonacci(7)连分式:g=g+f;黄金分割:f(k)=f(k
7、-1)+f(k-2);n=40;f=fibonacci(n);f(2:n)./f(1:n-1)f(2:n)./f(1:n-1)-phiFibonacci的兔子Fibonacci的兔子以黄金分割的速度增长。有两个解phi和(1-phi)由初始条件:是有理分式Fibonacci的兔子注意:没有半只兔子format long e n=(1:40);f=(phi.(n+1)-(1-phi).(n+1)/(2*phi-1)f=round(f)魔方阵 A=magic(3)sum(A)sum(A)sum(diag(A)sum(diag(flipud(A)sum(1:9)/38 1 63 5 74 9 2魔方
8、阵的八种组合 for k=0:3 rot90(A,k)rot90(A,k)end逆时阵旋转k*90度基本代数运算 X=inv(A)det(A)-360 0.1472 -0.1444 0.0639 -0.0611 0.0222 0.1056 -0.0194 0.1889 -0.1028 format rat 53/360 -13/90 23/360 -11/180 1/45 19/180 -7/360 17/90 -37/360 基本代数运算 r=norm(A)e=eig(A)s=svd(A)e=15.0000 4.8990 -4.8990s=15.0000 6.9282 3.4641r=15
9、NORM(X)is the largest singular value of X,max(svd(X).符号计算 A=sym(A)sum(A)sum(A)det(A)inv(A)eig(A)svd(A)100200300400500100200300400500600图象显示 load durer whos image(X)colormap(map)axis imageMelancolia,a Renaissance etching by Albrect Durer50100150200250300350501001502002503003504阶魔方阵 load detail image(
10、X)colormap(map)axis image4阶魔方阵 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 A=magic(4)A=A(:,1 3 2 4)4阶魔方阵:880个5阶魔方阵:275305224个6阶魔方阵:?秩和奇异阵 A=magic(4)det(A)inv(A)矩阵的秩是矩阵中线性无关的行和列的个数,一个n阶矩阵是奇异的当且仅当它的秩小于n rank(magic(4)秩和奇异阵 for n=1:24,r(n)=rank(magic(n);end (1:24)r bar(r)tiltle(魔方阵的秩)05101520250510152025 n:奇
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 上海复旦大学 matlab 课件 ppt
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内