
182 Introduction to Computational Linear Algebra
Thus, the resulting system obtained from (7.14) takes the following matrix
form:
AU = F, (7.15)
the matrix A ∈ R
N,N
being tri-diagonal. In case, a(x) = 1 and b(x) = 0, A is
the well-known “central difference matrix”:
A =
1
h
2
2 −1 0 ... 0
−1 2 −1 0 0
... ... ... ... ...
... 0 −1 2 −1
0 0 ... −1 2
, F =
f
1
+ α/h
2
f
2
...
f
M−1
f
M
+ β/h
2
.
In that well-known case and other more general cases, storing the matrix A
using the sparse commands facilities of MATLAB, we need to construct a data
structure of its coefficients.
The sparse MATLAB environment which handles efficiently sparse matrices as
discussed in