回 帖 发 新 帖 刷新版面

主题:[原创]各位大侠,我是matlab菜鸟,遇到一些问题,请指教啊!!!!!!!!!!

我想用matlab绘制一个三维极坐标的椭球体,但是始终不对,请指教啊!!!!!!!!!!!!!谢谢!!!!!!!!![em1]

回复列表 (共4个回复)

沙发

[x,y,z]=sphere(30);
X=a*x;   %%(a,b,c为椭球的半轴)
Y=b*y;
Z=c*z;
surf(X,Y,Z)

板凳

不好意思,看漏了极坐标。但好像surf函数只是支持笛卡尔坐标,那么可以先用pol2cart把极坐标转化成笛卡尔坐标就行了

3 楼


谢谢阿,那怎么转化呢?

4 楼

帮助里有:

    [X,Y,Z] = POL2CART(TH,R,Z) transforms corresponding elements of
    data stored in cylindrical coordinates (angle TH, radius R, height
    Z) to Cartesian coordinates X,Y,Z. The arrays TH, R, and Z must be
    the same size (or any of them can be scalar).  TH must be in radians.

我来回复

您尚未登录,请登录后再回复。点此登录或注册