hemicylinder
Version 1.0.0 (1,66 KB) von
Nick Van Oosterwyck
Generates cylinder 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
Zitieren als
Nick Van Oosterwyck (2024). hemicylinder (https://www.mathworks.com/matlabcentral/fileexchange/125105-hemicylinder), MATLAB Central File Exchange. Abgerufen .
Kompatibilität der MATLAB-Version
Erstellt mit
R2022b
Kompatibel mit R2006a und späteren Versionen
Plattform-Kompatibilität
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.0.0 |