x = linspace(0,1,6);
[X,Y] = meshgrid(x,x);
points = [8 9 10 11 14 15 16 17 22 23 28 29];
L = diag(-4*ones(1,12));
L(1,2) = 1;
L(1,5) = 1;
L(2,1) = 1;
L(2,3) = 1;
L(2,6) = 1;
L(3,2) = 1;
L(3,4) = 1;
L(3,7) = 1;
L(4,3) = 1;
L(4,8) = 1;
L(5,1) = 1;
L(5,6) = 1;
L(6,2) = 1;
L(6,5) = 1;
L(6,7) = 1;
L(7,3) = 1;
L(7,6) = 1;
L(7,8) = 1;
L(7,9) = 1;
L(8,4) = 1;
L(8,7) = 1;
L(8,10) = 1;
L(9,7) = 1;
L(9,10) = 1;
L(9,11) = 1;
L(10,8) = 1;
L(10,9) = 1;
L(10,12) = 1;
L(11,9) = 1;
L(11,12) = 1;
L(12,10) = 1;
L(12,11) = 1;
[V,D] = eig(-L);
Z = zeros(36,1);
Z(points) = V(:,1);
surf(X,flip(Y),transpose(reshape(Z,6,6)))
xlabel(‘x’)
ylabel(‘y’)
%% Increasing the number of points
M = 100;
x = linspace(0,1,M);
[X,Y] = meshgrid(x,x);
G = zeros(M);
last = 0;
for l=2:M-1
if l<=M/2
G(l,:) = [0,last+(1:M-2),0];
else
G(l,:) = [zeros(1,M/2),last+(1:M/2-1),0];
end
last = max(max(G));
end
L1 = delsq(G);
[V1,D1] = eigs(L1,1,'smallestabs');
Z = zeros(M^2,1);
Z(find(G')) = V1(:,1);
f = figure;
ax = axes;
s = surf(X,flip(Y),transpose(reshape(Z,M,M)));
s.EdgeColor = 'none';
clc
zlim([0,max(max(Z))]);
ax.CameraUpVector = [0 0 1];
ax.CameraViewAngle = 10;
ax.Position = [0 0 1 1];
ax.DataAspectRatio = [1 1 0.025];
view([49 27])
l1 = light;
l1.Position = [-0.4 -0.4 0.040];
l1.Style = 'local';
l1.Color = [0 0.8 0.8];
%
l2 = light;
l2.Position = [.05 -0.1 .04];
l2.Color = [0.8 0.8 0];
s.FaceColor = [0.9 0.2 0.2];
s.FaceLighting = 'gouraud';