0% found this document useful (0 votes)
10 views

Pregunta 1h

The document contains the definitions and operations of several matrices: A, B, C, D, K, and Q. It then performs various matrix multiplications and inversions on these matrices, including AxB, CxD, inv(A), inv(B), and inv(K). It also solves systems of equations to find the elements of the inverse of A.

Uploaded by

abel chinga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Pregunta 1h

The document contains the definitions and operations of several matrices: A, B, C, D, K, and Q. It then performs various matrix multiplications and inversions on these matrices, including AxB, CxD, inv(A), inv(B), and inv(K). It also solves systems of equations to find the elements of the inverse of A.

Uploaded by

abel chinga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

>> A=[-8,9,3;5,2,-7;-9,4,0]

A =

-8 9 3
5 2 -7
-9 4 0

>> B=[-5,3,-6;2,-3,5;6,9,8]

B =

-5 3 -6
2 -3 5
6 9 8

>> C=[-7,5;1,-3;-8,-9]

C =

-7 5
1 -3
-8 -9

>> D=[-3,-2,8;5,7,-4]

D =

-3 -2 8
5 7 -4

>> K=[742,-230,157,123;-230,217,-321,126;157,-321,743,-305;123,126,-305,869]

K =

742 -230 157 123


-230 217 -321 126
157 -321 743 -305
123 126 -305 869

>> Q=[2;6;-2;4]

Q =

2
6
-2
4

1.a

>> AxB=A*B

AxB =

76 -24 117
-63 -54 -76
53 -39 74
>> BxA=B*A

BxA =

109 -63 -36


-76 32 27
-75 104 -45

>> CxD=C*D

CxD =

46 49 -76
-18 -23 20
-21 -47 -28

>> DxC=D*C

DxC =

-45 -81
4 40

1.b

>> AxCxD=A*C*D

AxCxD =

-593 -740 704


341 528 -144
-486 -533 764

>> BxCxD=B*C*D

BxCxD =

-158 -32 608


41 -68 -352
-54 -289 -500

>> CxDxA=C*D*A

CxDxA =

561 208 -205


-151 -128 107
185 -395 266

>> CxDxB=C*D*B

CxDxB =

-588 -693 -639


164 195 153
-157 -174 -333

1.c
>> AxBt=A*B'

AxBt =

49 -28 57
23 -31 -8
57 -30 -18

>> BtxA=B'*A

BtxA =

-4 -17 -29
-120 57 30
1 -12 -53

>> BxAt=B*A'

BxAt =

49 23 57
-28 -31 -30
57 -8 -18

>> AtxB=A'*B

AtxB =

-4 -120 1
-17 57 -12
-29 30 -53

1.d

>> det(A)

ans =

457

>> det(B)

ans =

171.0000

>> det(A'*B)

ans =

7.8147e+04

1.e

>> Ainversa=inv(A)

Ainversa =

0.0613 0.0263 -0.1510


0.1379 0.0591 -0.0897
0.0832 -0.1072 -0.1335

>> syms a d g

>> Ainvunoadg=solve([-8*a+9*d+3*g==1,5*a+2*d-7*g==0,-9*a+4*d==0],[a,d,g])

Ainvunoadg =

struct with fields:

a: [1�1 sym]
d: [1�1 sym]
g: [1�1 sym]

>> Va=Ainvunoadg.a

Va =

28/457

>> Vd=Ainvunoadg.d

Vd =

63/457

>> Vg=Ainvunoadg.g

Vg =

38/457

>> syms b e h
>> Ainvunobeh=solve([-8*b+9*e+3*h==0,5*b+2*e-7*h==1,-9*b+4*e+0*h==0],[b,e,h])

Ainvunobeh =

struct with fields:

b: [1�1 sym]
e: [1�1 sym]
h: [1�1 sym]

>> Vb=Ainvunobeh.b

Vb =

12/457

>> Ve=Ainvunobeh.e

Ve =

27/457

>> Vh=Ainvunobeh.h

Vh =
-49/457

>> syms c f i
>> Ainvunocfi=solve([-8*c+9*f+3*i==0,5*c+2*f-7*i==0,-9*c+4*f+0*i==1],[c,f,i])

Ainvunocfi =

struct with fields:

c: [1�1 sym]
f: [1�1 sym]
i: [1�1 sym]

>> Vc=Ainvunocfi.c

Vc =

-69/457

>> Vf=Ainvunocfi.f

Vf =

-41/457

>> Vi=Ainvunocfi.i

Vi =

-61/457

1.f

>> Binversa=inv(B)

Binversa =

-0.4035 -0.4561 -0.0175


0.0819 -0.0234 0.0760
0.2105 0.3684 0.0526

1.g

>> Kinversa= inv(K)

Kinversa =

0.0030 0.0062 0.0017 -0.0007


0.0062 0.0255 0.0091 -0.0014
0.0017 0.0091 0.0050 0.0002
-0.0007 -0.0014 0.0002 0.0015

>> MD=Kinversa*Q

MD =

0.0368
0.1416
0.0491
-0.0039

You might also like