n=6;        %Number of iteration
N=(2^n)+1;      %Size of matrix
U=zeros(N,N);
%Set the initial height of the four corners
U(1,1)=rand;
U(1,N)=rand;
U(N,N)=rand;
U(N,1)=rand;
T=func(U);
xx=(1:N);
yy=(1:N);
[x,y]=meshgrid(xx,yy);
mesh(xx,yy,T);
axis off