hemicylinder
Version 1.0.0 (1,66 ko) par
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
Citation pour cette source
Nick Van Oosterwyck (2026). hemicylinder (https://fr.mathworks.com/matlabcentral/fileexchange/125105-hemicylinder), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Créé avec
R2022b
Compatible avec les versions R2006a et ultérieures
Plateformes compatibles
Windows macOS LinuxTags
Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.0 |
