%
MATLAB for FYS208
%
%% Plotting the 3-dim FYS208
%% Brillouin, 2dim crystal, tight binding
% can be run by Matlab< fff.html
T41=41;
T20=20;
for i=1:T41
x(i)=-pi+ pi/T20*(i-1);
end
for i=1:T41
y(i)=-pi+ pi/T20*(i-1);
end
for i=1:T41
for j=1:T41
f(i,j)=3.0-cos(x(i))-cos(y(j));
end
end
u(:)=3.0-cos(x(:));
%% Mesh surface:
surfl(f)
%% Add shading
shading interp
colormap(gray);
%% Plot in grey and add contours.... This is good !
surfc(f)
shading interp
%% Postscript
print -deps Plot1.eps
%% Aspect Ratio (get current ... gca )
set(gca,'AspectRatio',[1 1])
print -deps Plot2.eps
%% contour
contour(f,12)
set(gca,'AspectRatio',[1 1])
print -deps Plot2.eps
%% contour with labels
c= contour(f,12);
clabel(c);