필터 지우기
필터 지우기

View 2D Plane of 3D Graph

조회 수: 23 (최근 30일)
Michael Boyte
Michael Boyte 2023년 2월 28일
답변: Cameron 2023년 2월 28일
I have plotted several spheres and I would like to see only the circles created by those spheres at a given height along the z-axis. I have tried to udnerstand the slice fucntion, but I've been unsuccessful and I'm not certain its even the function I need to use. In short, I want to see the intersection of the spheres with the x-y plane at a given z-value. How can I do this?

채택된 답변

Cameron
Cameron 2023년 2월 28일
If you are unable to get slice to work, you can do something like this.
[X2,Y2,Z2] = sphere(100);
X = X2 + 0.5;
Y = Y2 + 0.2;
Z = Z2*0.5 + 0.1;
surf(X,Y,Z)
hold on
surf(X2,Y2,Z2)
hold off
p = gca;
p.View = [0,90];
Zslice = 0.2;
p.ZLim = [Zslice-0.005,Zslice+0.005];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by