当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

厦门大学数学科学学院:《高等代数》课程教学资源(应用与实验)MATLAB Ex 2 - Solving Linear Systems of Equations

资源类别:文库,文档格式:PDF,文档页数:2,文件大小:135.99KB,团购合买
点击下载完整版文档(PDF)

MATLAB Exercise 2 School of mathematical ces Xiamen University httplgdipke.xmuedu MATLAB Exercise 2 -Solving Linear Systems of Equations 1. Generate random5×5 matrices with integer entries(元素) by setting A-round(10*rand(5) and B=round(20*rand(5))-10 Use MATLAB to compute each of the following pairs of numbers In each case check whether he first is equal to the second a)AA b)JA+B AF+[B C)AB AlBI d)A'B'||A'‖B’l e)|+11f|AB1141 inv(X) returns the inverse of the square matrix X elp inv(A)returns the inverse of the square matrixa det(A)returns the determinant of the square matrix A A returns the conjugate transpose of A 2. Set A-round(10 *rand(6)). In each of the following, use MATLAb to compute a second matrix as indicated. State how the second matrix is related to A and compute the determinants of both matrices. How are the determinants related? a)B=A;B(2,)=A(1,),B(1,}=A(2,:) b)C=A;C(3,)4*A(3,:) c)D=A,D(5,)=A(5,)+2*A(4,) 3. Use Cramer's rule(det), backslash () operation, inv function, rref function respectively to solve the following systems. And check whether the results are the exact solutions of the corresponding equations. If not, try to show the reason x1+2x2=4 5x1+x2=4 4x,+2x-x,=2 x+3x2+x3=1 c){3x-x2+2x3=10 5 llx1+3x2=8 2x,+2 lp In command window input help rref to see the usage of this function 4. Let A=2 3 4, compute the third of column of A" by using Cramer's rule to solve Ax=e3. The result should be displayed in rational format 5. Let a be the matrix in ex4. Compute the adj A(A的伴随矩阵) by using the inv and det function 6. Compute the general solution of the following linear systems by using backslash (1), null and rref function x1+x2-5x3 x1+x2-5x3 a)14x+5x2+x=8 b){4x+5x+x1=8 2x+4x,+4x2=8 Ex2-1

MATLAB Exercise 2  School of Mathematical Sciences Xiamen University  http://gdjpkc.xmu.edu. Ex2­1  MATLAB Exercise 2 ­ Solving Linear Systems of Equations 1.  Generate random 5×5 matrices with integer entries(元素) by setting  A=round(10*rand(5)) and B=round(20*rand(5))­10  Use MATLAB to compute each of the following pairs of numbers. In each case check whether the first is equal to the second.  a) |A| |A’|  b) |A+B| |A|+|B|  c) |AB| |A||B|  d) |A’B’| |A’||B’|  e) 1  | A | - 1 | A| f) 1  | AB | - | |  | | A B inv(X) returns the inverse of the square matrix X Help inv(A) returns the inverse of the square matrix A  det(A) returns the determinant of the square matrix A  A’ returns the conjugate transpose of A  2.  Set A=round(10*rand(6)). In each of the following, use MATLAB to compute a second matrix  as indicated. State how the second matrix is related to A and compute the determinants of both  matrices. How are the determinants related? a) B=A; B(2, :) = A(1, :); B(1, :)=A(2, :)  b) C=A; C(3, :)=4*A(3, :)  c) D=A; D(5, :)=A(5, :)+2*A(4, :)  3.  Use Cramer’s rule (det),  backslash (\) operation,  inv function, rref function respectively to  solve the following systems.  And check  whether the results are the exact solutions  of the corresponding equations. If not, try to show the reason.  a) 1 2  1 2  2 4 2 2 2 x x  x x Ï + = Ì - = Ó b) 1 2  1 2  2 3 1 5 4 x x  x x Ï + = - Ì + = Ó c) 1 2 3  1 2 3  1 2  4 2 2 3 2 10 11 3 8 x x x  x x x  x x Ï + - = Ô Ì - + = Ô + = Ó d) 1 2 3  1 2 3  1 2 3  3 1 2 5 2 2 8 x x x  x x x  x x x Ï + + = Ô Ì + + = Ô - + - = - Ó Help In command window input help rref to see the usage of this function  4.  Let  1 2 3 2 3 4 5 4 6 A = ,  compute the third of column of 1 A - by using Cramer’s  rule to solve Ax=e3. The result should be displayed in rational format.  5.  Let  A be the matrix in Ex4. Compute  the adj  A (A 的伴随矩阵) by using the inv  and  det  function.  6.  Compute the general solution of the following linear systems by using backslash(\), null and rref function.  a) 1 2 3  1 2 3  1 2 3  2 3 0 4 5 8 2 4 2 x x x  x x x  x x x Ï + - = Ô Ì + + = Ô - - + = Ó b) 1 2 3  1 2 3  1 2 3  2 3 0 4 5 8 2 4 4 8 x x x  x x x  x x x Ï + - = Ô Ì + + = Ô + + = Ó

MATLAB Exercise 2 School of Mathematical Sciences Xiamen University httplgdipke.xmuedu 2x1+x,-3x3=0 7. Compute the general solutions of 4x,+5x2+x,=0 by using rref function 2x1-2x2-10x3=0 8.+ Use rand function to generate several4×3,3×1,3×4,4× I matrices, compare the results of the corresponding linear systems computed by \ inv and pinv Help pinv(A)returns the Moore-Penrose pseudoinverse of A, where A need not be a square matrIx 9. *Use rand to generate a linear system Ax=b. Try the display the result if r(a br(A); else display There is no solution. " (if) 10. Set A=11; 2 4 2: 21 1: B=3 12; 122: 314; C=A+i*B Use MATLAB to compute each of matrices. In each case check whether the first is equal to the If they are equal then display The first matrix is equal to the second one. Otherwise display The first matrix is not equal to the second one 2)A A 3)inv(A)pinv(A) 4)inv(B)pinv(B) Held A'returns the conjugate transpose of A A. returns the transpose of A nj (A)returns the conjugate of A 11. Use help to study functions: trace, rank, conj, rref, rrefmovie, format Ex2-2

MATLAB Exercise 2  School of Mathematical Sciences Xiamen University  http://gdjpkc.xmu.edu. Ex2­2  7.  Compute the general solutions of 1 2 3  1 2 3  1 2 3  2 3 0 4 5 0 2 2 10 0 x x x  x x x  x x x Ï + - = Ô Ì + + = Ô - - = Ó by using rref function.  8.  *Use rand function to generate several 4×3, 3×1; 3×4, 4×1 matrices, compare the results  of the corresponding linear systems computed by \, inv and pinv. Help pinv(A) returns the Moore­Penrose pseudoinverse of A, where A need not be a square matrix.  9.  *Use rand to generate a linear system Ax=b. Try the display the result if r(A b)=r(A); else display “There is no solution.” (if) 10.  Set A=[1 2 1; 2 4 2; 2 1 1]; B=[3 1 2; 1 2 2; 3 1 4]; C=A+i*B. Use MATLAB to compute each  of the following pairs of matrices. In each case check whether the first is equal to the second.  If they are equal then display ‘The first matrix is equal to the second one.’ Otherwise display  ‘The first matrix is not equal to the second one.’ 1) C’ C.’ 2) A’ A.’ 3) inv(A) pinv(A) 4) inv(B) pinv(B) Help A’ returns the conjugate transpose of A  A.’ returns the transpose of A  conj(A) returns the conjugate of A  11.  Use help to study functions: trace, rank, conj, rref, rrefmovie, format

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
已到末页,全文结束
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有