A = bucky();
[n, ~] = size(A);
A = A + 5*speye(n);  % ensure diagonal dominance
b = rand(n, 1);
y = A\b; % matlab's solution
x0 = ones(n, 1);
tol = 0.0000000001;
maxit = 100;

[x, conv] = myjacobi(A, b, x0, tol, maxit); 
norm(x - y)  % compare our solution to the  matlab's one

iters = length(conv); % actual number of iterations
i = 1:iters;

plot(i, log(conv), 'o-')
hold on
plot(i, -0.51*i, '--')
hold off