Slices through 3-D Volumes, formed by 1D-arrays
조회 수: 3 (최근 30일)
이전 댓글 표시
f=![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1260645/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1260645/image.png)
I have a set of 1D - arrays
and values of the inequality f.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1260650/image.png)
I need to build a series of slices for any of the planes of this volume. I don't know how to do this in Matlab, because the data is in vector form. Please help.
댓글 수: 2
KSSV
2023년 1월 12일
Your data lies in a sphere. You can make circular planes of required radius and center.
채택된 답변
Walter Roberson
2023년 1월 12일
Nx = 50;
Ny = 51;
Nz = 52;
load f
load x
load y
load z
figure();
PointSize = 20;
scatter3(x, y, z, PointSize, f); colorbar();
minx = min(x); maxx = max(x);
miny = min(y); maxy = max(y);
minz = min(z); maxz = max(z);
xvec = linspace(minx, maxx, Nx);
yvec = linspace(miny, maxy, Ny);
zvec = linspace(minz, maxz, Nz);
[Xq, Yq, Zq] = meshgrid(xvec, yvec, zvec);
Fq = griddata(x, y, z, f, Xq, Yq, Zq);
mask = Fq < 1/2 | Fq > 1;
Fq(mask) = nan;
figure();
sx = linspace(minx, maxx, 7);
sy = linspace(miny, maxy, 7);
sz = linspace(minz, maxz, 7);
H = slice(Xq, Yq, Zq, Fq, sx, sy, sz);
set(H, 'EdgeColor', 'none');
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!