Question

Use MATLAB to write your codes 2) Consider a matrix A with block matrices as follows: A11 A12 A=10A22 It can be shown that the inverse of A can be calculated by inverse of submatrices if A11, and A22 are squared matrices: A11 A12 0 A22 11 12422 0 Now consider a Matrix A with following submatrices: A11 = identity matrix A22 = identity matrix A12 [12 3:4 5-1] Write a code that check the identity shown above; steps are: a) Takes 4 sub matrices: A11, A22, A21, A12 b) Given the information about the matrix A, construct A: a. What is the size of A? (create a zero matrix with that size) c) d) e) show that they are equa create a variable LHS which uses matlab built-in function to take the inverse (calculate LHS) create a variable RHS which reconstruct the inverse given in the right hand side of the identity
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

MATLAB CODE

A11 = eye(2,2)
A12 = [1 2 3;4 5 -1]
A22 = eye(3,3)
A21 = zeros(3,2)

OUTPUT

Command Window >A11 eye (2,2) A12[1 2 3:4 5 -1] A22eye (3,3) A21 - zeros (3,2) A11 0 A12 5 -1 A22 A21 fx. >>

b)

MATLAB CODE

A = [A11 A12;A21 A22]

size(A)

OUTPUT

Command Window >> A = [A11 A12:A21 A22] size (A) 5 -1 ans - fx. >>

c)

MATLAB CODE

LHS=pinv(A)

OUTPUT

omman >> LHS=pinv (A) LHS = 0.0000 -0.0000 -0.0000 0.0000 1.0000 -0.0000-1.0000 -2.0000 -3.0000 1.0000 0.0000 0.0000 1.0000 1

d)

MATLAB CODE

a = pinv(A11)
d = pinv(A22)
b = -a*A12*d

RHS = [a b;A21 d]

OUTPUT

Command Window >> a = pǐnv (A11) d = pins(A22) b--a A12*d a= d= RHS 01-23 1-4-5

e)

MATLAB CODE

if isequal(int64(LHS),RHS)
disp 'Success'
end

OUTPUT

Add a comment
Know the answer?
Add Answer to:
Use MATLAB to write your codes Consider a matrix A with block matrices as follows: A...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Bonus: Implement the following algorithm in MATLAB and submit your solution as an m-file. Input: two...

    Bonus: Implement the following algorithm in MATLAB and submit your solution as an m-file. Input: two n x n matrices A, B, where n = 2k for some k = 0,1,2,... Output: the product C = AB. . For k = 0, both A and B consist of only one number, and C is the product of these numbers. . For k > 0, split A, B into 4 blocks of size 2-1 x 2-1 as in A = (Au:...

  • in matlab 6. Create a big matrix with submatrices: The following matrix G is created by inserting the matrices A, B, an...

    in matlab 6. Create a big matrix with submatrices: The following matrix G is created by inserting the matrices A, B, and C from Exercise 3, together with zero matrices and 2 x 2 identity AY NOT llr SIIAIut. UMOADIT, SOLD Og1 DISTIunUTII》 THIS CONTENT IS PROTECTED AND M 019 2 CopprightQ Schoall of Mathercatical and Statistical Sceom Ariaona State Cniseesity matrices in the appropriate position. Create the matrix using submatrioes A, B, C, zeros and eye (that is, you...

  • Exercise 1: Write MATLAB code to create a 5x5 matrix A with 2's on the diagonal, and -1 on the su...

    Exercise 1: Write MATLAB code to create a 5x5 matrix A with 2's on the diagonal, and -1 on the super- and sub-diagonal. Then replace the (1,1) element of A with a 1. (Make your commands capable of handling an arbitary sized NxN matrix by first defining N=5, then using the variable N as the size in each of the commands.)

  • 1. Write a MATLAB function that takes a matrix, a row number and a scalar as...

    1. Write a MATLAB function that takes a matrix, a row number and a scalar as arguments and multiplies each element of the row of the matrix by the scalar returning the updated matrix. 2. Write a MATLAB function that takes a matrix, two row numbers and a scalar as arguments and returns a matrix with a linear combination of the rows. For example, if the rows passed to the function were i and j and the scalar was m,...

  • In the next exercises, we consider square n X n matrices; I is the identity matrix...

    In the next exercises, we consider square n X n matrices; I is the identity matrix (In MATLAB eye (n) gives a square n by n matrix). If ex is the column unit vector which components are all O's except the kth component which is equal to 1, i.e., 이".e1 = 101 0 then the identity matrix I is such that: 10 000 ei = [100 01T, , el 1000 11T. 0 0 T' 0 0 1 To generate in...

  • Matlab answer only Form 1 6) [10 pts] Consider the following two matrices B=[S A 3...

    Matlab answer only Form 1 6) [10 pts] Consider the following two matrices B=[S A 3 1 5 -7 4 6-3] a) Obtain the sum of each row of matrix A. b) Use the size function to create a magic matrix P which has the same size as matrix A. c) Create a matrix called Q from the second column of matrix A d) Extract the four numbers in the lower left-hand corner of matrix A and create matrix R....

  • linear algebra Let V (71, 72, 3}, where 71 73=(2,0,3). (1,3,-1), 2 = (0, 1,4), and...

    linear algebra Let V (71, 72, 3}, where 71 73=(2,0,3). (1,3,-1), 2 = (0, 1,4), and (a) Prove: V is a basis. (b) Find the coordinates of (b, b2, bs) with respect to V = {71, U2, 3,}. (c) Suppose M and M' are matrices whose columns span the same vector space V. Let b be the coordinates of relative to M. Write a matrix equation that gives b', the coordinates of relative to M'. (Your answer should be a...

  • I need to Write a Matlab program to use Hebb rule with pseudo-inverse matrix to Distinguish betwe...

    I need to Write a Matlab program to use Hebb rule with pseudo-inverse matrix to Distinguish between the numbers from 0 to 9 written as follow 1. Consider the following patterns. 1) Write a Matlab program to reproduce the results using the Hebb rules. Try different input patterns in the network to test its capability. Explain your results. 2) Ropoai 1) using ho pudoinverse ule. How do the rosulis diffr from those of 1)? 1. Consider the following patterns. 1)...

  • please provide the matlab working screenshot 4. Consider the matrix 1 1 0 -1 0 -1 1 3 12 1 1 (a) Use Matlab to determin...

    please provide the matlab working screenshot 4. Consider the matrix 1 1 0 -1 0 -1 1 3 12 1 1 (a) Use Matlab to determine the reduced row echelon form of A. (b) If v, v2, vs, v4 are the column vectors of the matrix A, use your result from (a) to obtain a basis for the subspace of W-lin[vi, V2, vs, v4. Write the basis in the box below. 4. Consider the matrix 1 1 0 -1 0...

  • Write a c++ program: Many mathematical problems require the addition, subtraction, and multiplication of two matrices. Write an ADT Matrix. You may use the following class definition: const int MAX_RO...

    Write a c++ program: Many mathematical problems require the addition, subtraction, and multiplication of two matrices. Write an ADT Matrix. You may use the following class definition: const int MAX_ROWS = 10; const int MAX_COLS = 10; class MatrixType { public: MatrixType(); void MakeEmpty(); void SetSize(int rowsSize, int colSize); void StoreItem(int item, int row, int col); void Add(MatrixType otherOperand, MatrixType& result); void Sub(MatrixType otherOperand, MatrixType& result); void Mult(MatrixType otherOperand, MatrixType& result); void Print(ofstream& outfile); bool AddSubCompatible(MatrixType otherOperand); bool MultCompatible(MatrixType otherOperand);...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT