Hi, I've a grid
[X,Y,Z] = meshgrid(XI,YI,ZI);
where
XI = 1:1:4;YI = 1:1:4;ZI = -500:100:5000;
and a 3d surface defined by points xi, yi, zi
[A,B] = meshgrid(XI,YI);S = griddata(xi,yi,zi,A,B);
I've to performe simple index calculations (linear extrapolation of temperature with depth) on my grid [X,Y,Z] but with different coefficients depending on the node i,j,k position: above or below the surface S. I think I've to find k index of my grid that are above and below the surface.
for i = 1:4for j = 1:4for k = 1:(length(Z)-1)ind(i,j,k) = find(Z(i,j,k) >= S)endendend
The problem is that the dimension of the grid and surface matrix are different! Any idea how to solve this problem?
Gianluca
Best Answer