if I == J
   A(I,J) = 2;
elseif abs(I-J)==1
   A(I,J) = -1;
else
   A(I,J) = 0;
end
