2D情节的3D极线图线图、情节

2023-09-08 10:43:09 作者:回眸

我想绘制绕Y轴的三维图,Y = 100-X ^ 2,周期在360度。最后变得像一个圆锥体。那可能吗?我有一个数组 X = 1:1:100 ,和一个数组,尺寸(1 100)。

I would like to plot a 3D graph, y=100-x^2, cycle around the Y axis in 360 degrees. Eventually to become like a cone. Is that possible? I have an array x=1:1:100, and an array y, size(1 100).

我尝试过的ž阵列, Z = 1:1:100 因为这是第3轴的锥的基地。随着plot3我做Y = 100-X ^ 2的一个图。我想有点动画,并有最终锥形,或面锥体。

I tried an Z array, z=1:1:100 as the 3th axis in the base of the cone. With plot3 I done the one graph of y=100-x^2. I would like to kinda animate it and have eventually a cone, or a surface cone.

推荐答案

这是你正在寻找什么?

r = 1:1:100;
y = 100-r.^2;
theta = 0:pi/20:2*pi;
xx = bsxfun(@times,r',cos(theta));
zz = bsxfun(@times,r',sin(theta));
yy = repmat(y',1,length(theta));
surf(xx,yy,zz)

来源:Generating 3D绘图用曲线革命