I have a vector z which consists of function values defined on a 2D plane. I do not know the function though. I have tried interpolation with griddata and reshape to get z into a matrix but nothing seems to work. Perhaps I'm doing something fundamentally wrong so that's it's impossible to get the result I want? Help is much appreciated!
N = 100;
L = 1;
h = L/(N-1);
x = h*(0:N-1) - L/2;
coeff = -1/((pi)^2*h^2) ;
coeff = ones(100,1)*coeff;
B=[coeff coeff -4*coeff coeff coeff];
H=spdiags(B,[-3 -1 0 1 3],N,N);
[X,Y] = meshgrid(x,y) ;
Z = reshape(z,size(X)) ;
EDIT: As far as I know my problem lied in the construction of the matrix 'H'. It does not yield eigenvectors that are a lengthy enough to define a surface over the entire grid. For this you need a rank 3 tensor I think. Though I use the kronecker tensor product 'kron' to get all the same spacial information into a second order tensor. This way the eigenvectors are of correct size to 'reshape' them over the grid.
coeff = -h_bar^2/(2*mass*h^2) ;
D=spdiags([o t o] ,[-1 0 1],N,N);