23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2cylinder<br />

Purpose Generate cylinder<br />

Syntax [X,Y,Z] = cylinder<br />

[X,Y,Z] = cylinder(r)<br />

[X,Y,Z] = cylinder(r,n)<br />

cylinder(...)<br />

cylinder<br />

Description cylinder generates x, y, and z coordinates of a unit cylinder. You can draw the<br />

cylindrical object using surf or mesh, or draw it immediately by not providing<br />

output arguments.<br />

[X,Y,Z] = cylinder returns the x, y, and z coordinates of a cylinder with a<br />

radius equal to 1. The cylinder has 20 equally spaced points around its<br />

circumference.<br />

[X,Y,Z] = cylinder(r) returns the x, y, and z coordinates of a cylinder using<br />

r to define a profile curve. cylinder treats each element in r as a radius at<br />

equally spaced heights along the unit height of the cylinder. The cylinder has<br />

20 equally spaced points around its circumference.<br />

[X,Y,Z] = cylinder(r,n) returns the x, y, and z coordinates of a cylinder<br />

based on the profile curve defined by vector r. The cylinder has n equally<br />

spaced points around its circumference.<br />

cylinder(...), with no output arguments, plots the cylinder using surf.<br />

Remarks cylinder treats its first argument as a profile curve. The resulting surface<br />

graphics object is generated by rotating the curve about the x-axis, and then<br />

aligning it with the z-axis.<br />

Examples Create a cylinder with randomly colored faces.<br />

cylinder<br />

axis square<br />

h = findobj('Type','surface');<br />

2-361

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!