find index on 3d matrix
이전 댓글 표시
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:4
for j = 1:4
for k = 1:(length(Z)-1)
ind(i,j,k) = find(Z(i,j,k) >= S)
end
end
end
The problem is that the dimension of the grid and surface matrix are different! Any idea how to solve this problem?
Gianluca
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!