Question 10.6: Use MATLAB to compute the Cholesky factorization for the sam...
Use MATLAB to compute the Cholesky factorization for the same matrix we analyzed in Example 10.5.
[A]=\left[\begin{array}{ccc}6 & 15 & 55 \\15 & 55 & 225 \\ 55 & 225 & 979 \end{array}\right]Also obtain a solution for a right-hand-side vector that is the sum of the rows of [A]. Note that for this case, the answer will be a vector of ones.
The matrix is entered in standard fashion as
>> A = [6 15 55; 15 55 225; 55 225 979];
A right-hand-side vector that is the sum of the rows of [A] can be generated as
>> b = [sum (A (1,:)); sum (A (2,:)); sum (A (3,:))]
b =
76
295
1259
Next, the Cholesky factorization can be computed with
>> U = chol(A)
U =
2.4495 6.1237 22.4537
0 4.1833 20.9165
0 0 6.1101
We can test that this is correct by computing the original matrix as
>> U'*U
ans =
6.0000 15.0000 55.0000
15.0000 55.0000 225.0000
55.0000 225.0000 979.0000
To generate the solution, we first compute
>> d = U'\b
d =
31.0269
25.0998
6.1101
And then use this result to compute the solution
>> x = U\d
x =
1.0000
1.0000
1.0000