MATLAB 3D函数cylinder()

圆柱体创建单位圆柱体的x, y和z坐标。我们可以使用surf或mesh绘制圆柱对象, 也可以通过不提供输出参数来立即绘制它。
句法

[X, Y, Z] = cylinder // It returns the x, y, and z coordinates of a cylinder with a radius similar to 1. The cylinder has 20 similar spaced points around its circumference.[X, Y, Z] = cylinder(r) // It returns the x, y, and z coordinates of a cylinder using r to describe a profile curve. cylinder treats each component in r as a radius at equally spaced heights along with the unit height of the cylinder. [X, Y, Z] = cylinder(r, n) // It returns the x, y, and z coordinates of a cylinder based on the profile curve described by vector r. The cylinder has n similar spaced points around its circumference.cylinder(...) // with no output arguments, plot the cylinder using MATLAB surf.

例子
r=sin?(3π z)+20≤z≤1, 0≤θ≤2θz=[0: .02:1]'; r=sin(3*pi*z)+2; cyclinder(r), axis square

【MATLAB 3D函数cylinder()】输出
MATLAB 3D函数cylinder()

文章图片

    推荐阅读