Professional Documents
Culture Documents
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 =
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 =
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
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 =
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 =
ans =