I need help to obtain a discrete second order derivative operator, that could be applied on a matrix. The best way, I guess, is to reshape the matrix into vector form and create a diagonal matrix with the operator, which is easy for equally spaced data in the matrix,but how can I incorporate the distances (width and heigth of the cells) for unequally spaced data?
Could you possibly use the GRADIENT command? This allows you to pass in unevenly spaced values for X and Y.
Discrete Laplacian :
[x,y]=meshgrid(-4:.1:4); z=exp(-x.^2-y.^2); dz2=del2(z);
A fast gradient with 2nd order method for unevenly distributed data: FEX: DGradient.