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
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
ADVERTISEMENT