hemicylinder

Generates cylinder with hemispherical ends.
ダウンロード: 8
更新 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