0% found this document useful (0 votes)
53 views5 pages

Xycdf

The document describes 6 experiments involving matrix operations and eigendecomposition: 1. It calculates the product of two matrices A and B, and verifies that the order of multiplication does not change the result. 2. It verifies the associative and distributive properties of matrix multiplication hold true. 3. It shows that the transpose of the product of two matrices is not always equal to the product of their transposes. 4. It finds the inverse of a matrix A and uses it to solve the system of equations Ax=b. 5. It performs eigendecomposition on two matrices, decomposing each into its eigenvectors and eigenvalues. 6. It plots a decaying sinusoidal function

Uploaded by

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

Xycdf

The document describes 6 experiments involving matrix operations and eigendecomposition: 1. It calculates the product of two matrices A and B, and verifies that the order of multiplication does not change the result. 2. It verifies the associative and distributive properties of matrix multiplication hold true. 3. It shows that the transpose of the product of two matrices is not always equal to the product of their transposes. 4. It finds the inverse of a matrix A and uses it to solve the system of equations Ax=b. 5. It performs eigendecomposition on two matrices, decomposing each into its eigenvectors and eigenvalues. 6. It plots a decaying sinusoidal function

Uploaded by

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

EXPERIMENT 2

1 . CODE
A=[11 5; -9 -4]
B=[-7 -8;6 2]
C=A*B
D=B*A

OUTPUT
A = 11
-9
B = -7
6
C = -47
39
D = -5
48
COMMENT
matrices has

5
-4
-8
2
-78
64
-3
22
- The product of the
been calculated.

2 . a. CODE
A=[4 -2 1;6 8 -5;7 9 10]
B=[6 9 -4;7 5 3;-8 2 1]
C=[-4 -5 2;10 6 1;3 -9 8]
D=B+C
E=A*D
X=A*C
Y=B*C
Z=X+Y

OUTPUT
A=
4 -2
6
8
7
9
B= 6
9
7
5
-8
2
C = -4 -5
10
6
3 -9
D=
2
4
17 11
-5 -7

1
-5
10
-4
3
1
2
1
8
-2
4
9

E = -31 -13 -7
173 147 -25
117 57 112
X=
2 28 -21

VINI SHARMA 0812EI131061

Z = -31 -13 -7
173 147 -25
117 57 112
COMMENT- The associative property is
verified.
b. CODE
A=[4 -2 1;6 8 -5;7 9 10]
B=[6 9 -4;7 5 3;-8 2 1]
C=[-4 -5 2;10 6 1;3 -9 8]
D=A*B
E=D*C
X=B*C
Y=A*X

OUTPUT
A=
4 -2
6
8 -5
7
9 10
B =6
7
-8

9
5
2

-4
3
1

C = -4 -5
2
10
6
1
3 -9
8
D = 2 28 -21
132 84 -5
25 128
9
E=

209
297
1207

347
-111
562

-136
308
250

X =54 60 -11
31 -32 43
55 43 -6
Y = 209
347
297
-111
1207
562

-136
308
250

COMMENT- The distributive property was

Page 1

EXPERIMENT 2
132 84 -5
25 128
9
Y = 54 60 -11
31 -32 43
55 43 -6
OUTPUT
A=
4 -2
1
6
8 -5
7
9 10
B=
6
9 -4
7
5
3
-8
2
1
C=
-4 -5
2
10
6
1
3 -9
8
D=
2 28 -21
132 84 -5
25 128
9
E=
50 24 -79
79 53 12
-13 41 -8
COMMENT They are unequal.
b. CODE
A=[4 -2 1;6 8 -5;7 9 10]
B=[6 9 -4;7 5 3;-8 2 1]
C=[-4 -5 2;10 6 1;3 -9 8]
D=B*C
E=A*D
X=A*B
Y=X*C

-2
8
9

3.a. CODE
A=[4 -2 1;6 8 -5;7 9 10]
B=[6 9 -4;7 5 3;-8 2 1]
C=[-4 -5 2;10 6 1;3 -9 8]
D=A*B
E=B*A

D=
54 60
31 -32
55 43
E=
209
297
1207
X=
2 28
132 84
25 128
Y=
209
297
1207

1
-5
10

VINI SHARMA 0812EI131061

-11
43
-6
347
-111
562

-136
308
250

-21
-5
9
347
-111
562

-136
308
250

COMMEN They are equal.


c. CODE
A=[4 -2 1;6 8 -5;7 9 10]
B=[6 9 -4;7 5 3;-8 2 1]
C=[-4 -5 2;10 6 1;3 -9 8]
D=A*B
F=D'
X=B'
Y=A'
Z=X*Y

OUTPUT
A = 4
6
7

OUTPUT
A=
4
6
7

verified.

B =

Page 2

6
7
-8

-2
8
9

1
-5
10

9
5
2

-4
3
1

EXPERIMENT 2
B=
6
7
-8
C=
-4
10
3

X =

9
5
2

-4
3
1

-5

C = -4
10
3

-9

D =

28
84
128

-21
-5
9

F =

132
84
-5

25
128
9

2
132
25

7
5
3

-8
2
1

4
-2
1

6
8
-5

7
9
10

2
28
-21

132
84
-5

25
128
9

Z =

2
1
8

2
6

6
9
-4

Y =

-5
6
-9

COMMENT - They are unequal.


d. CODE
A=[4 -2 1;6 8 -5;7 9 10]
B=[6 9 -4;7 5 3;-8 2 1]
C=[-4 -5 2;10 6 1;3 -9 8]
D=A+B
F=D'
X=B'
Y=A'
Z=X+Y

OUTPUTA = 4 -2
1
6
8 -5
7
9 10
B =6
9 -4
7
5
3
-8
2
1
C = -4 -5
2

VINI SHARMA 0812EI131061

2
28
-21

Z =10 13 -1
7 13 11
-3 -2 11
COMMENT- They are equal.
4. CODEA=[4 -2 6;2 8 2;6 10 3]
B=[8;4;0]
C=inv(A)
D=C*B

OUTPUT
A =4 -2
6
2
8
2
6 10
3
B =8
4
0
C =-0.0244 -0.4024 0.3171
-0.0366 0.1463 -0.0244
0.1707 0.3171 -0.2195
D =-1.8049
0.2927
2.6341
5. CODE
A=[4 2 -3;-1 2 3;2 5 7]
B=[1 2 3;8 7 6;5 3 1]

Page 3

EXPERIMENT 2
10
6
1
3 -9
8
D = 10
7 -3
13 13 -2
-1 11 11
F =10 13 -1
7 13 11
-3 -2 11
X=6
7 -8
9
5
2
-4
3
1
Y=4
6
7
-2
8
9
1 -5 10

A=
2.1458 + 1.0110i
0
0
0
2.1458 - 1.0110i
0
0
0
8.7083
V=
-0.2657 -0.6220 0.4082
-0.8910 0.0285 -0.8165
-0.3683 0.7825 0.4082
B=
11.8655
0
0
0 -2.8655
0
0
0 0.0000

[V,A]=eig(A)
[V,B]=eig(B)

OUTPUT
A=
4
2 -3
-1
2
3
2
5
7
B=
1
2
3
8
7
6
5
3
1
V=
0.8221
0.8221
-0.3509
-0.4803 + 0.1864i -0.4803 - 0.1864i
0.4254
0.1879 - 0.1528i 0.1879 + 0.1528i
0.8342

6. CODE
x=0:.1:15
w=15
y=exp((-.7)*x).*sin(w*x)
plot(x,y)
grid on

OUTPUT

VINI SHARMA 0812EI131061

Page 4

EXPERIMENT 2

VINI SHARMA 0812EI131061

Page 5

You might also like