% Vicol Vlad, changes by M.O.
%
% This file generates a test matrix A and a right hand side b
% for the iterative solvers on Homework 5 and 6

function [A,b] = matrix(n,beta)

  A = diag(2*ones(n,1)) - diag(ones(n-1,1),1) - diag(ones(n-1,1),-1); 
  A(1,n) = -beta;
  A(n,1) = -beta;

  b = ones(n,1);

end