0% found this document useful (0 votes)
19 views6 pages

Matlab 4

This document contains the solutions to multiple math problems involving matrix operations and linear algebra. Problem 30 involves multiplying and inverting matrices. Problem 33 and 34 use linear solving functions. Additional problems 1 and 2 also demonstrate inverse matrix calculations and linear solving.

Uploaded by

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

Matlab 4

This document contains the solutions to multiple math problems involving matrix operations and linear algebra. Problem 30 involves multiplying and inverting matrices. Problem 33 and 34 use linear solving functions. Additional problems 1 and 2 also demonstrate inverse matrix calculations and linear solving.

Uploaded by

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

Table of Contents

........................................................................................................................................................ 1
Conor Carson Matlab 4 ........................................................................................................................ 1
Problem 30 ........................................................................................................................................ 1
Problem 33 ........................................................................................................................................ 3
Problem 34 ........................................................................................................................................ 3
Additional Problem 1 ........................................................................................................................... 4
Additional Problem 2 ........................................................................................................................... 5

clc
clear all

Conor Carson Matlab 4


Problem 30
A= [5 -3 7; 1 0 -6; -4 8 9]
B= [3 2 -1; 6 8 -7; 4 4 0]
C= [-9 8 3; 1 7 -5; 3 3 6]

% a)
A*B
B*A
% no they are not equal
% b)
(B*C)^-1
(B^-1)*(C^-1)
% no they are not equal
% c
(inv(A))'
inv(A')
% yes they are equal
% d
(A+B)'
A'+B'
% yes they are equal

A =

5 -3 7
1 0 -6
-4 8 9

B =

3 2 -1

1
6 8 -7
4 4 0

C =

-9 8 3
1 7 -5
3 3 6

ans =

25 14 16
-21 -22 -1
72 92 -52

ans =

21 -17 0
66 -74 -69
24 -12 4

ans =

-0.1200 0.0053 0.0627


-0.0571 0.0000 0.0500
0.0515 -0.0212 -0.0008

ans =

-0.0676 0.0433 0.0421


0.0737 -0.0607 -0.0180
0.0222 -0.0444 0.0074

ans =

0.1912 0.0598 0.0319


0.3307 0.2908 -0.1116
0.0717 0.1474 0.0120

ans =

0.1912 0.0598 0.0319


0.3307 0.2908 -0.1116
0.0717 0.1474 0.0120

ans =

2
8 7 0
-1 8 12
6 -13 9

ans =

8 7 0
-1 8 12
6 -13 9

Problem 33
A=[-2 5 7; 3 -6 2; 9 -3 8];
B=[-17.5; 40.6; 56.2];
linsolve(A,B)
% x=3.2 y=-4.6 z=1.7

ans =

3.2000
-4.6000
1.7000

Problem 34
A=[2 -4 5 -3.5 1.8 4;
-1.5 3 4 -1 -2 5;
5 1 -6 3 -2 2;
1.2 -2 3 4 -1 4;
4 1 -2 -3 -4 1.5;
3 1 -1 4 -2 -4];
B=[52.52; -21.1; -27.6; 9.16; -17.9; -16.2;]
linsolve(A,B)
% a=1.8 b=-6.2 c=2.6 d=-1.6 e=4.4 f=-0.6

B =

52.5200
-21.1000
-27.6000
9.1600
-17.9000
-16.2000

ans =

3
1.8000
-6.2000
2.6000
-1.6000
4.4000
-0.6000

Additional Problem 1
A=[100 -300;300 600];
B=[12; -6]

a=A(1,1)
b=A(1,2)
c=A(2,1)
d=A(2,2)

dA=(a*d)-(b*c)

iA=[d -c; -b a]/dA

I=iA*B
% I1=.06 I2=.02

B =

12
-6

a =

100

b =

-300

c =

300

d =

600

dA =

4
150000

iA =

0.0040 -0.0020
0.0020 0.0007

I =

0.0600
0.0200

Additional Problem 2
A=[cosd(23.6) sind(23.6);sind(111.2) cosd(111.2)];
B=[0; 93]

a=A(1,1)
b=A(1,2)
c=A(2,1)
d=A(2,2)

dA=(a*d)-(b*c)

iA=([d -c; -b a])/dA

T=iA*B

% T1=123.0512 T2=-120.9446

B =

0
93

a =

0.9164

b =

0.4003

c =

5
0.9323

d =

-0.3616

dA =

-0.7046

iA =

0.5132 1.3231
0.5682 -1.3005

T =

123.0512
-120.9446

Published with MATLAB® R2023a

You might also like