function [x,sol]=feuler(a,b,N,T,M,t)
h=(b-a)/(N+1); k=T/M;
x=zeros(N+2,1); 
uold=zeros(N,1);unew=uold; F=uold;
for i=1:N+2
	x(i)=a+(i-1)*h;
end
A=zeros(N,N);
la=k/(h^2);
A(1,1)=1-2*la; A(1,2)=la;
for i=2:N-1
	A(i,i)=1-2*la;
        A(i,i-1)=la;A(i,i+1)=la;
end
A(N,N-1)=la;A(N,N)=1-2*la;
for i=1:N
	uold(i)=g(x(i+1));
end
for i=1:N
	F(i)=f(x(i+1));
end
j=0; 
while (j*k<t)
	unew=A*uold+F;
	j=j+1;
	uold=unew;
end
sol=zeros(N+2,1);
sol=[0;unew;0];