Why in the name of god and little green apples are you using Gauss-Seidel for this? (I can only assume this is a homework assignment, intended to show you why some iterative solvers need not always converge.) If that is the case, then not getting a solution is not a problem. WTP?
A direct solve using backslash would probably take less than a second, far faster if you created the matrix as a sparse one. And, since you DID create it as sparse, WHY? WHY? WHY?
A=spdiags([-1*e 2*e -1*e],-1:1,n,n);
B=repelem([210,10,1010],[1,n-2,1])';
So a TINY fraction of a second to perform the solve.
Note that some matrices cannot be solved using Gauss-Seidel. This is why other iterative solvers are employed. Here, an iterative solver is just insane though. Far too small a problem to bother with one.
Should Gauss-Seidel converge at all on this problem?
full(A(1:10,1:10))
ans =
3 -1 0 0 0 0 0 0 0 0
-1 2 -1 0 0 0 0 0 0 0
0 -1 2 -1 0 0 0 0 0 0
0 0 -1 2 -1 0 0 0 0 0
0 0 0 -1 2 -1 0 0 0 0
0 0 0 0 -1 2 -1 0 0 0
0 0 0 0 0 -1 2 -1 0 0
0 0 0 0 0 0 -1 2 -1 0
0 0 0 0 0 0 0 -1 2 -1
0 0 0 0 0 0 0 0 -1 2
Gauss-Seidel converges for strictly diagonally dominant problems, but also for symmetric positive definite matrices.
Diagonal dominance is not the case here, though G-S can be applied to some other problems that are not strictly diagonally dominant, where it may fail, or be extremely slowly convergent. (That is surely the case here.) As such, I am not even remotely surprised that it is not converging for you as fast as you want. As far as being positive definite, A is indeed so, but barely that. (A quick check on the spectral radius, and I get 0.999999247009037, so close to 1 that Gauss-Seidel will probably never converge in any reasonable time.)
What should you do to make it converge faster? Don't use Gauss-Seidel. Use backslash. Yeah, I know, you can't. ARGH.
You might play around with successive over-relaxation or other (better) iterative solvers, but I would guess it won't help that much here. Yes, it will be faster, but this is a bad problem for iterative methods. A quick test showed that SOR, using even the optimal parameter, was not even close to convergence after a half milllion iterations.
So again, the answer is your code was not expected to converge.