Page 70 - Applied Numerical Methods Using MATLAB
P. 70
PROBLEMS 59
1.14 Backslash(\) Operator
Let’s play with the backslash(\) operator.
(a) Use the backslash(\) command, the minimum-norm solution (2.1.7) and
the pinv() command to solve the following equations, find the residual
error ||A i x − b i ||’s and the rank of the coefficient matrix A i ,and fillin
Table P1.14 with the results.
x 1
123 6
(i) A 1 x = x 2 = = b 1 (P1.14.1)
456 15
x 3
x 1
123 6
(ii) A 2 x = x 2 = = b 2 (P1.14.2)
246 8
x 3
x 1
123 6
(iii) A 3 x = x 2 = = b 3 (P1.14.3)
246 12
x 3
Table P1.14 Results of Operations with backslash (\)Operatorand pinv( ) Command
backslash(\) Minimum-Norm or pinv() Remark
LS Solution on rank(A i )
x ||A i x − b i || x ||A i x − b i || x ||A i x − b i || redundant/
inconsistent
1.5000 4.4409e-15
0 (1.9860e-15)
A 1 x = b 1
1.5000
0.3143 1.7889
A 2 x = b 2 0.6286
0.9429
A 3 x = b 3
2.5000 1.2247
A 4 x = b 4
0.0000
A 5 x = b 5
A 6 x = b 6
(cf) When the mismatching error ||A i x − b i ||’s obtained from MATLAB 5.x/6.x version are slightly different, the
former one is in the parentheses ().