Skip to main content
留学咨询

辅导案例-PROJECT 2

By May 15, 2020No Comments

MATLAB PROJECT 2 Please read the Instructions located on the Assignments page prior to working on the Project. BEGIN with creating a Live Script Project2. Note: All exercises in this project have to be completed in the Live Script using the Live Editor. Please refer to the MATLAB video that explains how to use the Live Script: https://www.mathworks.com/videos/using-the-live-editor-117940.html?s_tid=srchtitle The final script has to be generated by exporting the Live Script to PDF. Each exercise has to begin with the line Exercise# You should also mark down the parts such as (a), (b), (c), and etc. This makes grading easier. Important: we use the default format short for the numbers in all exercises unless it is specified otherwise. We do not employ format rat since it may cause problems with running the codes and displaying matrices in the Live Script. If format long had been used, please make sure to return to the default format in the next exercise. Part I. Elementary Row-Operations Exercise 1 (4 points) Difficulty: Moderate In this exercise you will create the three types of elementary matrices, analyze their properties, and perform elementary row-operations by using the created matrices. **Write the three functions in MATLAB: function E1=ele1(n,r,i,j) function E2=ele2(n,i,j) function E3=ele3(n,j,k) Each of the functions has to generate one of the three types of the elementary n n× matrices: E1, E2, or E3. To create an elementary matrix, you should start with the identity matrix eye(n) and follow a description for this type of the matrix given below: Matrix E1 is obtained from eye(n) by replacing (row j) with [(row j) + (row i) ⋅ r]. Matrix E2 is obtained from the matrix eye(n) by interchanging rows i and j. Matrix E3 is obtained from eye(n) by multiplying row j by k. The inputs i and j are indexes of the rows in the range from 1 to n. The inputs k and r are scalars. **Type the functions in your Live Script: type ele1 type ele2 type ele3 Part 1 In this part of the exercise, you will create the elementary matrices for the given variables and work with them. **Input the variables: n=4; r=5; i=1; j=3; k=2; (a) **Run the command I=eye(4) (display the output). **Then, run each of the created functions ele1, ele2, and ele3 on the given sets of variables. Your outputs will be three matrices E1, E2, E3. (Display the outputs.) % Write a comment how each of the matrices E1, E2, and E3 has been generated from the matrix I. (b) **Run the commands given below to calculate the determinants: detI=det(I) detE1=det(E1) detE2=det(E2) detE3=det(E3) % Write a comment in the Live Script about the relations between the determinants of E1, E2, E3 and the determinant of the original matrix I. (c) **Calculate the inverses of the matrices: invE1=inv(E1) invE2=inv(E2) invE3=inv(E3) % Compare invE1, invE2, and invE3 with the matrices E1, E2, and E3, respectively, and write comments on the relations between them. (d) **Type and output the matrix M=[1 1 1 1; 2 2 2 2; 3 3 3 3; 4 4 4 4] in your Live Script. Calculate the three products E1*M, E2*M, and E3*M and output them. % Write a comment how the matrix M was modified after performing each multiplication. Part 2 **Within your Live Script, create a matrix A by starting with eye(5) and performing the following sequence of elementary row-operations: first, replace (row4) with [(row4) + (row2) ⋅3], then, interchange rows 1 and 3 of the obtained matrix, and, finally, scale row5 of the matrix from the previous step by 6 to get the output matrix A. Display A. Note: To complete this part, you, should, first, create (and output) the required elementary matrices for the corresponding sets of variables (the variables are specific for each function!) and use consecutive three step left-multiplication to get the matrix A. % Explain in your Live Script a reason why the obtained matrix A is invertible. **Calculate (and output) the inverse of A, by using the MATLAB command inv1=inv(A) **Then, calculate and output the matrix inv2 which is the inverse of A obtained by multiplying (in the reverse order!) the inverses of the elementary matrices whose product is A. (You can apply a MATLAB command inv() to the matrices E1, E2, E3.) **Run a conditional statement in the Live Scrip that would check if the matrices inv1 and inv2 match. If yes, output a message that the inverses match; otherwise, output the message: “Check the coding!” (This message, if received, should prompt you to make corrections and re-run the Section.) Part II. Application to Physics Exercise 2 (3 points) Difficulty: Easy Theory: In this Exercise you will work with an application of Linear Algebra to solving a problem using Hook’s Law from Physics. We will consider an elastic beam which is supported on each end and is subject to forces applied at n points. Let vector f list the forces at the n points and let vector y in n list the amounts of deflection (displacements) of the beam at these points. Hooke’s Law from Physics describes the relation between the vector of forces and the deflection vector as D=y f , where D is a flexibility matrix. The matrix 1S D−= is called the stiffness matrix. (For more information, please refer to Section 2.2, Example 3 of the textbook.) The function that you will create calculates the forces applied at the points when the amounts of deflection are measured and the flexibility matrix D is given. If the flexibility is measured in inches of deflection per pound of load, then the stiffness is given in pounds of load per inch of deflection. If the flexibility units are centimeters per newton of force, then the units for stiffness are newtons per centimeter of deflection. **Write a MATLAB function that begins with function [S,f]=beam(D,y) S=[]; f=[]; n=length(y); **First, the function has to check whether the following two conditions hold: a square matrix D is an n n× matrix and D is invertible. (Use the command rank in your code to determine whether D is invertible.) If it is not the case, the program terminates and returns a message that D is not a flexibility matrix. The empty outputs for S and f will stay. (They do not need to be displayed.) If both conditions hold, you will proceed with the following tasks: (1) calculate and output the stiffness matrix S (see the Theory above); (2) calculate and output the vector f of forces for the given deflection vector y by using the stiffness matrix S; (3) verify that the physical meaning of a jth column of the stiffness matrix S (for all 1:j n= ) is that it is numerically equal to the vector of forces that have to be applied to n points to produce a unit deflection at the point j and zero deflections at all other points. If your code shows that it is true, output the message that the physical meaning of the stiffness matrix is valid; otherwise, the message could be “I may need to check the code”. % Write a comment that would explain a meaning of the negative entries of the matrix S. **Type the function beam in your Live Script. **Run the function [S,f]=beam(D,y) on the following sets of variables (display the variables in your Live Script): (a) D=0.1*rand(4), y=randi([20 50], 3,1) (b) D=0.01*magic(4), y=randi([20 50], 4,1) (c) D=0.01*rand(6), y=0.1*randi([10 20], 6, 1) Part III. Solving Equations In this part of the project, you will learn the basics on solving equations of the form A =x b when A is an invertible matrix. You should read the instructions carefully and perform the indicated tasks in MATLAB. Solving Matrix Equations. Suppose A is an invertible n n× matrix and you are solving the equation Ax = b. By the Invertible Matrix Theorem, there exists a
unique solution for any b in n  . There are various methods of finding the solution. Three of them are outlined below. (1) There is a special operator in MATLAB, \ , called backslash that usually gives an excellent result. To use it, store A and b and type: x=A\b. Backslash is the best of the methods for finding a solution. It works fast and minimizes a round-off error. It also checks the condition number on the coefficient matrix. If the condition number is large, it will warn you by printing message: “Matrix is close to singular or badly scaled. Results may be inaccurate.” Please refer to the MATLAB documentation on the condition number for more information: https://www.mathworks.com/help/matlab/ref/cond.html?s_tid=doc_ta (2) The other method is using a built-in MATLAB function inv, which also checks the condition number, but calculating inv(A) requires a lot more arithmetic than backslash. (3) The third method uses row reduction algorithm to find the solution. The command rref([A b]) gives the reduced echelon form of the augmented matrix and, then, we output its last column as the solution. However, it is not advisable to use rref command to solve real world problems. This function was written to help students to learn linear algebra, so its algorithm is not accurate and it will not warn you if your system is one of those for which it is hard to get an accurate solution. But, for the matrices with integer entries, we can use this algorithm to find the solution. Exercise 3 (5 points) Difficulty: Moderate Part 1. Solving a system Ax = b **Create a function in MATLAB that begins with: function [C,N]=solvesys(A,b) format long [~,n]=size(A); C=[]; N=[]; The inputs are an n n× matrix A and a column vector b with n entries. If A is invertible, the outputs are: a matrix C, whose 3 columns are the solutions x1, x2, x3 obtained by the three different methods described above, and the vector N whose 3 entries are the 2-norms of the vectors of the differences between each two distinct solutions. Note: We are using format long here to display a number in exponent format with 15 digit mantissas. If, later on, you will need to switch back to the default format, type and run format **First, we check if A is invertible. Important Note: Use the MATLAB command rank to determine whether a matrix is invertible. The command det cannot be used in this context due to the round off error in MATLAB calculation of the determinant of a matrix. **If A is not invertible, output the corresponding message and the empty outputs for C and N will stay (they do not need to be displayed). Also, in this case, there exist two possibilities for the system Ax = b that you will need to program: “the system is inconsistent” and “the system is consistent, but the solution is not unique”. Use the command rank to program each of the two possible outcomes and the corresponding output messages. Then, the program terminates. **If A is invertible, first, output a message that the matrix A is invertible. Then, your function will find the solution using the three methods (1), (2), (3) – they give you the vectors x1, x2, x3, respectively. These vectors will form the columns of the matrix C. That is, we assign C=[x1, x2, x3 ] and output C with the message that the solutions obtained by the different methods are the columns of the matrix C (display C). The function will also return a column vector N=[n1;n2;n3]; where n1=norm(x1-x2); n2=norm(x2-x3); n3=norm(x3-x1); Note: The entries of the vector N are the 2-norms of the vectors of the differences between each two distinct solutions. Each entry is calculated by using a built-in MATLAB function norm, which is the square root of the sum of the squares of the entries of a vector. The vector N gives an idea how “different” are the solutions obtained by the different methods. Display the vector N with the message that it represents the norms of the differences between the solutions obtained by the different methods. **Type the function solvesys in your Live Script. **Run the function [C,N]=solvesys(A,b)on the sets of variables given below: (a) A=magic(6); b=fix(10*rand(6,1)) (b) A=magic(4); b=ones(4,1) (c) A=magic(7); b=fix(10*rand(7,1)) (d) A=eye(4); b=fix(10*rand(4,1)) % Write a comment on the output for part (d) by comparing the solution with the vector b. (e) A=randi(20,4), b=fix(10*rand(4,1)) (f) A=hilb(7); b=fix(10*rand(7,1)) (g) A=magic(3); b=fix(10*rand(3,1)) Part 2. Condition Numbers This part has to be completed directly in the Live Script. **Find the condition numbers of the matrices magic(7) and hilb(7): c1=cond(magic(7)) c2=cond(hilb(7)) % Compare c1 and c2 with the number 1. How would you explain, using the condition numbers c1 and c2, why the norms of the differences between the solutions obtained by the different methods in Part 1, (f) are larger than the ones in Part 1, (c)? **Find the condition number c3 of the matrix magic(6). Then, find the reciprocal condition number of magic(6): rc3=rcond(magic(6)) Also, run the command in your Live Script: inv(magic(6)) % You can see a “Warning”. Take a look at the output for (a) in Part 1 and state what the actual type of the matrix magic(6) is and how it is reflected in the condition and reciprocal condition numbers of this matrix. **Run and output det(magic(6)) %Does it show as a zero? If not, does it mean that the matrix magic(6) is invertible? Explain please. **Explore the sensitivity of a badly conditioned matrix hilb(7): Input: A=hilb(7); Type and run the following code in the Live Script: b=ones(7,1); x=A\b; b1=b+0.01; y=A\b1; norm(x-y) rc=rcond(A) %Using the outputs norm(x-y) and rc, tell whether the system Ax=b with the coefficient matrix A=hilb(7)is sensitive to perturbations. **Re-run the code given above for A=magic(7); %Comment on sensitivity to perturbations of the system Ax=b for A=magic(7)in comparison with A=hilb(7)by analyzing the corresponding outputs for the norm(x-y)and rc. More information on the reciprocal condition numbers can be found on the MATLAB page: https://www.mathworks.com/help/matlab/ref/rcond.html?s_tid=doc_ta Exercise 4 (6 points) Difficulty: Hard In this exercise, you will be solving a non-homogeneous system Ax = b ( ≠b 0 ) with a general m n× matrix A. The case when there are infinitely many solutions is included. **Create a function in MATLAB that begins with the lines: function x=nonhomogen(A,b) format [~,n]=size(A); fprintf(‘Reduced echelon form of [A b] is ‘) R=rref([A,b]) x=[]; Note: we do not put semicolon after the line R=rref([A,b])to have R printed – the reduced echelon form of the augmented matrix [A,b] will allow to verify your outputs by inspection. **First, you will need to determine whether the system is consistent and, if “yes”, whether there is a unique solution or there are infinitely many solutions. You could use a conditional “if … elseif … else” statement. (1) If the equation Ax=b is not consistent, output the message ‘The system is inconsistent’ and the stored empty output for x will stay. (2) If the equation is consistent and the solution is unique, output the message ‘The system has a unique solution’ and use the backslash operator, that is assign x=A\b, to find the solution (see Exercise 3 of this Project). (3) If the equation is consistent and there are infinitely many solutions – output a message ‘There are infinitely many solutions’. In this case, we will represent the general solution x of a non-homogeneous system as a sum of the general solution of the corresponding homogeneous system and a particular solution p of the non-homogeneous system. To get the output x, you will need to construct another function in the file [C,p] = homobasis_b(A,b) which is a modification of the function C = homobasis(A) created in Project1, Exercise 5. Here is a description of how
to create the function homobasis_b: When a homogeneous system has nontrivial solutions, its general solution is the Span of the columns of the matrix C, where C is the output matrix of the function homobasis (see Project1, Exercise 5). The Span of the columns of C is also called the column space of C and is denoted Col(C). To create a function [C,p] = homobasis_b(A,b), which will output the matrix C and the vector p, you will need to modify the code for homobasis in the following way: 1) Remove the part of the code that deals with a system having only the trivial solution. 2) Leave only those commands that determine and output the free variables and construct the matrix C. Output C with the message ‘a basis for the solution set of the homogeneous system is formed by the columns of the matrix C’. (Display C) 3) Add a few lines to the code that would generate and output the particular solution p of the non-homogeneous system. It can be done in a way similar to creating the matrix C but with some adjustments: use the matrix R=rref([A,b])and obtain the vector p by modifying the last column of that matrix. Hint: You might find it helpful, first, write the solution of a sample non-homogeneous system on paper using the reduced echelon form, R=rref([A,b]), and, then, code it in your file. You may notice that the ordered entries of p corresponding to the free variables must be zero, and the other entries come from the last column of the matrix R=rref([A,b]). Output the vector p with the message: ‘particular solution of the non-homogeneuos system is the vector p’. (Display p) This will be the end of your function [C,p] = homobasis_b(A,b). Here is the final part of your function x=nonhomogen(A,b) After you have created the function homobasis_b, you will insert the line [C,p] = homobasis_b(A,b); into the function nonhomogen for part (3) (when there are infinitely many solutions) and complete the code for nonhomogen with these lines: syms Col(C), syms p fprintf(‘the general solution of the non-homogeneous system is\n’) fprintf(‘the column space of the matrix C translated by the vector p’) x=Col(C)+p (The first line introduces symbolic variables, the second and third lines display a message, and the last line represents the output x in terms of the symbolic variables.) **Type the functions homobasis_b and nonhomogen in your Live Script. **Run the function x=nonhomogen(A,b) on the following sets of variables: (a) A=[1 2 -3], b=randi(10,1,1) (b) A=magic(3), b=randi(10,3,1) (c) A=magic(4), b=randi(10,4,1) (d) B=[0 1 2 3;0 2 4 6]; A=[B; eye(4)], b=sum(A,2) (e) A=[0 1 0 2 0 3; 0 2 0 4 0 6; 0 4 0 8 0 6], b=ones(3,1) (f) A=[0 1 0 2 0 3; 0 2 0 4 0 6; 0 4 0 8 0 6], b=sum(A,2) (g) A=[0 0 1 2 3;0 0 2 4 5], b=A(:,end) (h) A=[0 0 1 2 3;0 0 2 4 6], b=A(:,end) Here is an example how the output for part (h) could appear in your Live Script: %(h) A=[0 0 1 2 3;0 0 2 4 6], b=A(:,end) A = 2×5 0 0 1 2 3 0 0 2 4 6 b = 2×1 3 6 x=nonhomogen(A,b); Reduced echelon form of [A b] is R = 2×6 0 0 1 2 3 3 0 0 0 0 0 0 There are infinitely many solutions a free variable is x1 a free variable is x2 a free variable is x4 a free variable is x5 a basis for the solution set of homogeneous system is formed by the columns of the matrix C = 5×4 1 0 0 0 0 1 0 0 0 0 -2 -3 0 0 1 0 0 0 0 1 particular solution of the non-homogeneuos system is the vector p = 5×1 0 0 3 0 0 the general solution of the non-homogeneous system is the column space of the matrix C translated by the vector p x = Part IV. Area, Volume, and Graphics in MATLAB GOAL: In this part, you will work with applications of matrices and determinants to Geometry and, specifically, to calculation of the area or volume. You will also touch a basis of graphics in MATLAB, when working with transformations of the plane. Exercise 5 (3 points) Difficulty: Easy Theory: The area of a parallelogram in 2 , built on non-parallel vectors 1 2,v v , and the volume of a parallelepiped in 3 , built on non-coplanar vectors 1 2 3, ,v v v , is det A (or abs(det A)), where 1 2[ ]A = v v and 1 2 3[ ]A = v v v , respectively. (See Section 3.3 of the textbook for details.) In this exercise, you will be given 2 vectors in 2 , 1 2andv v , and 3 vectors in 3  , 1 2 3, , and v v v , on which a parallelogram or parallelepiped, respectively, may or may not be built. **Create a function in MATLAB that begins with the lines: function D=areavol(A) format D=0; which takes as an input a matrix A, whose columns are the vectors on which a parallelogram or parallelepiped may possibly be built. **First, your function has to check whether the given vectors are linearly independent. Use the function rank to verify it. **If the vectors are not linearly independent, then a parallelogram in 2 or parallelepiped in 3  cannot be built. In this case, the function outputs a corresponding message, which has to be specific to whether it is a parallelogram or parallelepiped that cannot be built, and terminates the program. The stored output 0 for D will stay. **If the vectors are linearly independent, the function calculates the area or the volume, D, and outputs one of the following messages along with the value of D: “The area of the parallelogram is” (display the area D) or “The volume of the parallelepiped is” (display the volume D) Hint: in order to display a correct message whether it is a parallelogram or parallelepiped and whether it is the area or the volume, you should keep track on the number of rows (or columns) of A and use a conditional statement. **Type the function areavol in your Live Script. **Run the function D=areavol(A) on each of the following matrices. (The input matrices A have to be displayed.) (a) A=magic(3) (b) A=randi(10,2) (c) A=fix(10*rand(3)) (d) B=randi([-10,10],2,1); A = [B,2*B] (e) X=randi([-10,10],3,1);Y=randi([-10,10],3,1);A=[X,Y,X+Y] Exercise 6 (3 points) Difficulty: Easy In this exercise, you will plot figures in xy -plane and consider their images under the transformations of the plane such as reflections and shears. **Create, output, and display the matrices whose descriptions are given below. Each of the matrices is the standard matrix of the indicated transformation of the xy − plane. HS (horizontal shear with 2k = ) VS (vertical shear with 2k = ) RX (reflection across the x-axis) RY (reflection across the y-axis) RS (reflection across the line y x= ) RA (reflection across the line y x= − ) (If you need help with these transformations, please refer to the textbook, Section 1.9.) **Create the following function in MATLAB – the code is given below: function C=transf(A,E) C=A*E; x=C(1,:);y=C(2,:); plot(x,y) v=[-5 5 -5 5]; axis(v) grid end An input E is a 2 x 5 matrix whose columns are the vectors of the coordinates of the vertices of a close polygonal line. An input A will be a matrix that performs a required transformation. **Type the function transf in your Live Script. % Analyze and write a short comment on each of the lines of the code for transf. The initial input E is a 2 by 5 matrix whose columns represent the vertices of a unit square with the first vertex at the origin and the other vertices listed in the counterclockwise direction: 0 1 1 0 0 0 0 1 1 0 E  =     **Input the matrix E in your Live Script. **Next, type A=eye(2) hold Run the function C=transf(A,E) Your first outputs will be the matrix C, which has to be displayed, and the plot, which is a unit square whose vertices are defined by the columns of C. **Then, you will continue by choosing a sequence of the transformations, such that each
consecutive transformation will be applied to the previously created figure, until you obtain the figure presented at the end of this Exercise. To perform a consecutive transformation, you will need to do the following in the Live Script: (1) re-assign to the matrix E the output matrix C from the previous transformation; (2) assign to the matrix A the standard matrix of the required transformation; (3) run the function C=transf(A,E) You will repeat this sequence of commands until the figure below is created – display all output matrices C. Please make sure that your submission will include the single graph displayed below. Note: if you are re-running the Section in your Live Script, you may need to do it twice to have all plots displayed on a single graph. Part V. Cofactors, Determinants, and Inverse Matrices In this part of the project, you will write a code that calculates a matrix of cofactors of a given n n× matrix a, which you will be using for computing the determinant and the inverse of an invertible matrix a. Theory: 1) The determinant of a can be computed by using a cofactor expansion across any row or down any column of a. For the reference see Section 3.1 of the textbook. 2) The inverse of an n n× invertible matrix a can be computed by using the method based on the Cramer’s Rule. Specifically, 1 1 adj det − =a a a , where adj a denotes the adjugate (or classical adjoint) of a matrix a, which is the transpose of the matrix whose entries are the cofactors of a . (For the reference see Section 3.3 of the textbook.) Exercise 7 (6 points) Difficulty: Very Hard Part 1 ** Create a function that begins with function C=cofactor(a) The function has to generate ( 1) ( 1)n n− × − matrices i jA ( 1: , 1: )i n j n= = . Each i jA is obtained from a by deleting row i and column j. The output matrix C is an n n× matrix [ ] ( )( , ) , 1:C C i j i j n= = , whose entries are the cofactors calculated by the formulas ( , ) ( 1) det ( )i j i jC i j A += − . Note: in this part, we use a MATLAB built-in function det on the matrices i jA of the sizes ( 1) ( 1)n n− × − . Output the matrix C with the message “a matrix of cofactors is” and display C. Part 2 ** Create a function that will compute the determinant D of a matrix a. The matrix C of the cofactors of a will be used to calculate the non-zero determinant. The function begins with function D=determine(a,C) D=[]; **First, the function has to check if the determinant is zero. You will need to use the command rank. If the determinant is a 0, the function outputs the corresponding message and assigns D=0. After that, the program terminates. **If the determinant is not a 0, the function calculates the cofactor expansion across each row of a – they form the entries of the vector D1; and it calculates the cofactor expansion down each column of a – they form the entries of the vector D2. According to the theory, all entries of vectors D1 and D2 must be the same. You have to verify that it is the case. I suggest to take the first entry of the vector D1, that is D1(1), as a reference, and calculate the absolute value of the difference between the number D1(1) and each entry of the vectors D1 and D2. If each of the values is zero (for MATLAB it is less than 10 ^ ( 7)− ) the code assigns (and outputs) D = D1(1); otherwise, the function outputs a message “Something went wrong!” (This message should never be received!), and the output D=[]; will stay. Hint: You could use “for loop” or vectorized statement and “while loop” within your code (the command break stops executing “while loop”, if needed). **Then, your function will calculates the determinant by using a built-in MATLAB function d=det(a); You will compare d with (nonzero and nonempty!) D. If the absolute value of the difference (D – d) is less than 10^(-7), output D with a message “the determinant is” (display D); otherwise, output a message “Check the code!”. Part 3 **Create a function that computes the matrix 1B −= a for an invertible matrix a. It begins with the lines below and accepts as inputs the matrix C of the cofactors of the matrix a and the (non-empty!) value D of the determinant of a. function B=inverse(a,C,D) B=[]; **First, the function has to check if the matrix a is invertible. You can either use the command rank to verify it directly or you can use the output D of the function determine. If a is not invertible, display the corresponding message and terminate the code. The output B=[]; will stay. If a is invertible, we calculate the inverse matrix B of a by means of the formula ( )1 * transposeB C D = , where D is the determinant of a, which is (nonempty and nonzero!) output of the function determine, and C is the matrix of cofactors, which is the output of the function cofactor. **Then, you will verify that your output B matches the output of the built-in MATLAB function inv. First, output and display the matrix E=inv(a) with a message that E is the inverse of the matrix a calculated by MATLAB function. Next, use closetozeroroundoff function with the parameter p=7 to verify that B and E match. If it is the case, output a message that “the inverse is calculated correctly and it is the matrix” and display B. If B and E do not match, output a message which can be something like “What is wrong?!” Part 4 **Type the functions closetozeroroundoff, cofactor, determine, and inverse in the Live Script. **For each of the matrices a in parts (a)-(e) below, run the functions in the following order: C=cofactor(a) D=determine(a,C) B=inverse(a,C,D) (a) a=diag([1,2,3,4]) (b) a=ones(5) (c) a=magic(5) (d) a=magic(4) (e) a=hilb(4) **THIS IS THE END OF PROJECT 2

admin

Author admin

More posts by admin