《matlab讲义4.ppt》由会员分享,可在线阅读,更多相关《matlab讲义4.ppt(12页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Week 4wDeterminantwInner ProductsGiven A=aijWhere Mij is the submatrix obtained by deleting row i and column j.Why compute det(A)?det(A)=0 A is singularDeterminantdet(A)=ad-bcFor 3-by-3 matrixdet(A)=aei+dhc+gbf ceg fha ibdNot true for general n-by-n matrix.For 2-by-2 matrixIf n=20,n!=2 1018 operatio
2、ns.Assuming 109 operations/sec.2 109 sec.=100yr.So how det(A)is computed?Find it by Matlab!Wn n Wn-1 n (n-1)Wn-2 n!W1=n!1=n!If work of computing det(An)=Wn,thenn=500;A=rand(n);%generate a n-by-n matrixtic;%set the clock to zerov=det(A);%compute the determinanttoc%show the elapsed timeTo determine th
3、e timingn time ratio500 0.1090 -1000 0.7350 6.7420005.8440 7.95400043.5000 7.44Conclusion:det(An)=O(n3)Let V be a vector space.A function F:V VC is an inner product if Inner ProductsF(u,v)=ut vIn Matlab:ut v=u*v or dot(u,v)Example 2:V=M2x3(R)=set of all 2-by-3 real matrices.Is it an inner product?Example 1:V=Rn.2.1.3.4.5.ButThus F(A,B)may not be an inner product.To show that it is not an inner product,we need to find A,B,C,M23(R),such that F(A+B,C)F(A,C)+F(B,C).Can you find them by Matlab?In Matlab:F(A,B)=max max(abs(A*B)Can you think of another inner product for M23(R)?