
clear
close all

fid=fopen('gitter.grid','r');
num=fscanf(fid,'%i',2);
np=num(1);
nt=num(2);

ptmp=fscanf(fid,'%f',[2,np]);
ttmp=fscanf(fid,'%f',[3,nt]);

fclose(fid);

px=ptmp(1,:)';
py=ptmp(2,:)';

triangles=ttmp'+1;

clear ptmp ttmp


load f.dat

figure
triplot(triangles,px,py)
axis square

figure
trisurf(triangles,px,py,f)
colormap winter;
shading interp;
lighting phong;
light;
view ( -40, 80 );
axis square
