function A=my_triag3(N,x,q,p);
%N=length(x)
A=zeros(N);
h=x(2)-x(1);
for i=2:N-1
    A(i,i)=2+h^2*q(x(i));
    A(i,i-1)=-1-p(x(i))*h/2;
    A(i,i+1)=-1+p(x(i))*h/2;
end
A(1,1)=2+h^2*q(x(1));A(1,2)=-1+p(x(1))*h/2;
A(N,N)=2+h^2*q(x(N));A(N,N-1)=-1-p(x(N))*h/2;