%Example 1 page 519
clear all
colormap(jet)
N=9;n=100;
U=zeros(n+1,N+2);
% Excercise 3 
%U(1,:)=100*sin(pi*(1:N+2)/11);
U(1,:)=100;
 for ii=1:n
     for j=2:N+1
 U(ii+1,j)=(U(ii,j+1)+2*U(ii,j)+U(ii,j-1))/4;
end
 end
for k=1:5
U2(k,:)=U(20*k+1,:);
end
round(U2)
surf(U)
