hemicylinder

Generates cylinder with hemispherical ends.
8.0 次下载
更新时间 2023/2/20

查看许可证

Adaption of the default Matlab sphere function to create cylinders with hemispherical ends.
Syntax
[X,Y,Z] = hemicylinder
[X,Y,Z] = hemicylinder(r)
[X,Y,Z] = hemicylinder(r,h)
[X,Y,Z] = hemicylinder(r,h,n)
hemicylinder(___)
hemicylinder(ax,___)
Description
[X,Y,Z] = hemicylinder returns the x-, y-, and z- coordinates of a cylinder with hemispherical ends without drawing it. The returned cylinder with hemispherical ends has a radius equal to 1, a cylinder height equal to 1, 20 equally spaced points around its circumference and two hemisphere that consist each of 20-by-20 faces.
The function returns the x-, y-, and z- coordinates as three 42-by-21 matrices.
To draw the cylinder with hemispherical ends using the returned coordinates, use the surf or mesh functions.
[X,Y,Z] = hemicylinder(r) returns the x-, y-, and z- coordinates of a cylinder with hemispherical ends with a radius equal to r and a cylinder height equal to 1. The function returns the x-, y-, and z- coordinates as three 42-by-21 matrices.
[X,Y,Z] = hemicylinder(r,h) returns the x-, y-, and z- coordinates of a cylinder with hemispherical ends with a radius equal to r and a cylinder height equal to h. The function returns the x-, y-, and z- coordinates as three 42-by-21 matrices.
[X,Y,Z] = hemicylinder(r,h,n) returns the x-, y-, and z- coordinates of a cylinder with hemispherical ends with a radius equal to r and a cylinder height equal to h. The function returns the x-, y-, and z- coordinates as three (2n+2)-by-(2n+2) matrices.
hemicylinder(___) plots the cylinder with hemispherical ends without returning the coordinates. Use this syntax with any of the input arguments in previous syntaxes.
hemicylinder(ax,___) plots into the axes specified by ax instead of the current axes. Specify the axes as the first input argument.
See Also

引用格式

Nick Van Oosterwyck (2024). hemicylinder (https://www.mathworks.com/matlabcentral/fileexchange/125105-hemicylinder), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2022b
与 R2006a 及更高版本兼容
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0