2D plot in 3D polar graph

僤鯓⒐⒋嵵緔 提交于 2019-12-11 06:29:49

问题


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).

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.


回答1:


Is this what you are looking for?

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)

Source: Generating a 3D plot by revolution of a curve



来源:https://stackoverflow.com/questions/22030074/2d-plot-in-3d-polar-graph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!