function mat = matper(n,l)

mat = [];

for k = 1:(n-1)
        mat(k+1,k) = -1;
end

for k = 1:(n-1)
        mat(k,k+1) = -1;
end

for  k = 1:n
        mat(k,k) = 2+l*(-1)^k;
end

res = mat;

end

