You can find the area along any line for the surface given by using the "interp2" to interpolate th function along the specific points and then applying the basic definition for the area of a trapezium. The area of a trapezium is A = (a+b)*h/2 where a and b are the heights of the parallel sides and h is the distance between them. Please see example below:
clear; clc;
% Read table:
T = readtable('data.csv');
% Plot surface:
x = T.(1)*180 ;
y = T.(2)*180 ;
z = T.(3) ;
xi = linspace(min(x),max(x));
yi = linspace(min(y),max(y));
[X,Y] = meshgrid(xi,yi);
Z = griddata(x,y,z,X,Y);
surf(X,Y,Z)
shading interp
colorbar
% Assuming points P1 and P2 and interpolating Z values on the surface along
% the connecting line
x1 = xi(1); x2 = xi(100);
y1 = yi(1); y2 = yi(100);
t = linspace(0, 1, 100); % 100 points along the line
x_line = x1 + t * (x2 - x1);
y_line = y1 + t * (y2 - y1);
z_line = interp2(X, Y, Z, x_line, y_line);
hold on
plot3(x_line,y_line, z_line);
dx = sqrt((x_line(2)-x_line(1))^2+(y_line(2)-y_line(1))^2);
Area = 0;
for i = 1:length(z_line)-1
% Itreratively find area of trapezium
Area = Area + (z_line(i)+z_line(i+1)/2)*dx;
end
Hope this helps!