Matlab includes a highly complete numerical library for the resolution of large sparse linear systems (type help sparfun for more information). For instance, it is possible to perform the Gaussian elimination method on a tridiagonal matrix using the following procedure.
N = 10; a = 2; c = 1; A = sparse(2:N,1:N-1,-c,N,N) + sparse(1:N,1:N,a,N,N) + sparse(1:N-1,2:N,-c,N,N); full(A) b = ones([N,1]); x=A\b
Here is the result :
x = 5.0000 9.0000 12.0000 14.0000 15.0000 15.0000 14.0000 12.0000 9.0000 5.0000