How to integrate over a discrete 2D surface in MATLAB?
https://stackoverflow.com/questions/23688669Save this matrix, and then you can make it a continuous function using interp2: function z_interp = fun (x,y) z_interp = interp2 (Xdata,Ydata,Zdata,x,y); end. Then you can use integral2 to find the integral: q = integral2 (@fun,xmin,xmax,ymin,ymax) where @fun is your function handle that takes in two inputs. Share. Improve this answer.