You are on page 1of 3

Matlab 4.

2 Marvin Jesse
2.
>> A = [1 -1 2 0 1 0;2 1 1 1 1 0; 1 1 0 2 2 0]

A=

1 -1 2 0 1 0
2 1 1 1 1 0
1 1 0 2 2 0

>> rref(A)

ans =

1.0000 0 1.0000 0 0.2500 0


0 1.0000 -1.0000 0 -0.7500 0
0 0 0 1.0000 1.2500 0

x5 = t , free variable
x4 + 1.25x5 = 0
x4 = -1.25x5 = -1.25t
x3 = s, free variable
x2 – x3 - 0.75x5 = 0
x2 = x3 + 0.75x5 = s + 0.75t
x1 + x3 + 0.25x5 = 0
x1 = -x3 – 0.25x5 = -s – 0.25t

3.
>> A = [1 -1 2 0 1;2 1 1 1 1; 1 1 0 2 2]

A=

1 -1 2 0 1
2 1 1 1 1
1 1 0 2 2

>> rref(A)

ans =

1.0000 0 1.0000 0 0.2500


0 1.0000 -1.0000 0 -0.7500
0 0 0 1.0000 1.2500
>> rref(A')

ans =

1 0 0
0 1 0
0 0 1
0 0 0
0 0 0

They are not the same; they have different values and their matrix dimension is also
different

Matlab 4.3
1.
>> A1 = [1 1 0; 2 0 1; 1 0 1]

A1 =

1 1 0
2 0 1
1 0 1

>> rref([A1 eye(size(A1))])

ans =

1 0 0 0 1 -1
0 1 0 1 -1 1
0 0 1 0 -1 2

The inverse is
0 1 -1
1 -1 1
0 -1 2

>> A2 = [1 1 0; 0 1 1; 1 0 1]

A2 =

1 1 0
0 1 1
1 0 1
>> rref([A2 eye(size(A2))])

ans =

1.0000 0 0 0.5000 -0.5000 0.5000


0 1.0000 0 0.5000 0.5000 -0.5000
0 0 1.0000 -0.5000 0.5000 0.5000

The inverse is
0.5000 -0.5000 0.5000
0.5000 0.5000 -0.5000
-0.5000 0.5000 0.5000

2.
a)
>> invert(A)
>>>>>> Error: Matrix is singular.
b)
>> invert(B)

ans =

-1.7778 0.8889 -0.1111


1.5556 -0.7778 0.2222
-0.1111 0.2222 -0.1111
Non-singular matrix
c)
>> invert(C)

ans =

0.2000 0.1067 0.0533 -0.0933


0.1818 0.1030 -0.0848 0.0121
0.1455 -0.1042 0.0388 0.0230
-0.2848 0.0097 0.0352 0.0521
Non-singular matrix
d)
>> invert(D)
>>>>>> Error: Matrix is singular.

You might also like