clear all; close all;
n = input('n = ');
maxit = input('maximum number of iterations= ');
niter = 1;
tol = input('tolerance= ');
omega = input('omega= ');
A = gallery('poisson',n);
x = ones(n^2,1);
b = A*x;

err = zeros(maxit,1);
x = zeros(n^2,1);
L = tril(A,-1);
D = diag(diag(A));
U = triu(A,1);

% make here your SOR code

% Plot the error as function of the iteration number
figure

% niter: the number of iterations to compute the solution
semilogy(err(1:niter));

