RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • addpoints
    • ancestor
    • animatedline
    • area
    • autumn
    • axes
    • axis
    • bar
    • barh
    • bone
    • box
    • caxis
    • cla
    • clf
    • clim
    • colorbar
    • colorcube
    • colormap
    • colororder
    • contour
    • contour3
    • contourf
    • cool
    • copper
    • copyobj
    • cylinder
    • daspect
    • datacursormode
    • dataTipTextRow
    • drawnow
    • errorbar
    • fcontour
    • figure
    • fill
    • fill3
    • findobj
    • fsurf
    • gca
    • gcf
    • get
    • gobjects
    • gray
    • grid
    • groot
    • heatmap
    • hgload
    • hgsave
    • hidden
    • hist
    • histogram
    • histogram2
    • hold
    • hot
    • image
    • imagesc
    • imshow
    • inferno
    • isgraphics
    • ishandle
    • jet
    • legend
    • line
    • lines
    • linkaxes
    • loglog
    • magma
    • mesh
    • meshc
    • openfig
    • opengl
    • pan
    • parula
    • patch
    • pie
    • pink
    • plasma
    • plot
    • plot3
    • plotmatrix
    • plotyy
    • polarhistogram
    • polarplot
    • polarscatter
    • print
    • quiver
    • quiver3
    • ribbon
    • saveas
    • savefig
    • scatter
    • scatter3
    • semilogx
    • semilogy
    • set
    • sgtitle
    • shading
    • sphere
    • spring
    • stackedplot
    • stairs
    • stem
    • subplot
    • subtitle
    • summer
    • suptitle
    • surf
    • surfc
    • text
    • textscatter
    • textscatter3
    • title
    • triplot
    • turbo
    • view
    • viridis
    • waitbar
    • winter
    • wordcloud
    • xlabel
    • xlim
    • xline
    • xscale
    • xtickangle
    • xtickformat
    • xticklabels
    • xticks
    • ylabel
    • ylim
    • yline
    • yscale
    • ytickangle
    • ytickformat
    • yticklabels
    • yticks
    • zlabel
    • zlim
    • zoom

cylinder — Create or plot cylinder surface coordinates.

cylinder constructs X, Y, and Z grids for a unit-height cylinder with a configurable real radius profile and circumferential resolution. A call with no requested outputs plots through the existing surface renderer.

Syntax

X = cylinder
X = cylinder(r)
X = cylinder(r,n)
[X,Y] = cylinder
[X,Y] = cylinder(r)
[X,Y] = cylinder(r,n)
All supported cylinder forms
X = cylinder
X = cylinder(r)
X = cylinder(r,n)
[X,Y] = cylinder
[X,Y] = cylinder(r)
[X,Y] = cylinder(r,n)
[X,Y,Z] = cylinder
[X,Y,Z] = cylinder(r)
[X,Y,Z] = cylinder(r,n)
cylinder
cylinder(r)
cylinder(r,n)
cylinder(r,n,Name,Value,...)
cylinder(Name,Value,...)
cylinder(ax,...)

Inputs

r
Type
NumericArray
Required
Yes
Default
—
Description
Real radius profile; a scalar repeats at the base and top.
n
Type
IntegerScalar
Required
Yes
Default
—
Description
Positive number of equal circumference divisions.
r
Type
NumericArray
Required
Yes
Default
—
Description
Real radius profile.
n
Type
IntegerScalar
Required
Yes
Default
—
Description
Positive circumference division count.
Name,Value
Type
Any
Required
Variadic
Default
—
Description
Supported surface property name/value pairs.
Name,Value
Type
Any
Required
Variadic
Default
—
Description
Supported surface property name/value pairs for statement-form plotting.
ax
Type
Any
Required
Yes
Default
—
Description
Existing target axes handle.
arguments
Type
Any
Required
Variadic
Default
—
Description
Radius, resolution, and supported surface properties.
NameTypeRequiredDefaultDescription
rNumericArrayYes—Real radius profile; a scalar repeats at the base and top.
nIntegerScalarYes—Positive number of equal circumference divisions.
rNumericArrayYes—Real radius profile.
nIntegerScalarYes—Positive circumference division count.
Name,ValueAnyVariadic—Supported surface property name/value pairs.
Name,ValueAnyVariadic—Supported surface property name/value pairs for statement-form plotting.
axAnyYes—Existing target axes handle.
argumentsAnyVariadic—Radius, resolution, and supported surface properties.

Returns

X
Type
NumericArray
Description
Cylinder x coordinates.
Y
Type
NumericArray
Description
Cylinder y coordinates.
Z
Type
NumericArray
Description
Equally spaced heights from zero to one.
NameTypeDescription
XNumericArrayCylinder x coordinates.
YNumericArrayCylinder y coordinates.
ZNumericArrayEqually spaced heights from zero to one.

Returned values from cylinder depend on how many outputs the caller requests.

Errors

RunMat:cylinder:OutputCount
When
More than three outputs are requested.
Message
cylinder returns at most three coordinate arrays
RunMat:cylinder:InvalidArgument
When
Radius, resolution, axes, or plot options are invalid.
Message
cylinder input is invalid
RunMat:cylinder:OutOfMemory
When
The coordinate geometry overflows or the exact host allocation cannot be admitted.
Message
cylinder grid is too large
IdentifierWhenMessage
RunMat:cylinder:OutputCountMore than three outputs are requested.cylinder returns at most three coordinate arrays
RunMat:cylinder:InvalidArgumentRadius, resolution, axes, or plot options are invalid.cylinder input is invalid
RunMat:cylinder:OutOfMemoryThe coordinate geometry overflows or the exact host allocation cannot be admitted.cylinder grid is too large
RunMat:cylinder:InternalCoordinate publication or plotting fails.cylinder could not publish the surface
RunMat:cylinder:CancelledManaged host allocation is cancelled; CPU work interruptions retain the canonical execution-service cause.cylinder coordinate allocation was cancelled

Coordinates and shapes

[X,Y,Z] = cylinder returns three 2-by-21 host Double matrices for a radius-one, unit-height cylinder. The final column closes the circumferential seam.

A vector profile r contributes one row per radius at equally spaced heights; scalar r is repeated at the base and top. With resolution n, the grids are m-by-(n+1), with m=2 for scalar r.

One-, two-, and three-output calls return the leading coordinate grids without plotting. An empty profile retains a 0-by-(n+1) coordinate shape but cannot be plotted.

Plot forms and placement

Statement-form cylinder, cylinder(r), and cylinder(r,n) publish a surface in the current axes. cylinder(ax,...) targets an existing axes; supported surface name-value pairs are accepted only on the plotting forms.

The radius is a real host scalar or vector and n is a finite positive whole scalar. Typed integer n is a gated RunMat extension decoded exactly for the structural extent. Coordinate values remain Double.

No cylinder provider kernel or automatic upload is registered. Explicit GPU radius or resolution inputs reject before a readback, while resident arrays in other plot calls retain their existing owners.

Examples

Construct tapered cylinder coordinates

[X,Y,Z] = cylinder([1 0.5 1],12);
size(X)
size(Y)
size(Z)

Expected output:

ans =
     3    13

Plot the default unit cylinder

cylinder;
axis equal;

Using cylinder with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how cylinder changes the result.

Run a small cylinder example, explain the result, then change one input and compare the output.

FAQ

What is the default output size?⌄

Each of X, Y, and Z is 2-by-21; a vector of m radii and count n gives m-by-(n+1) grids.

Does a call without outputs return coordinates?⌄

No. Statement form plots; assign outputs to obtain coordinate arrays.

Related Plotting functions

2D Charts

area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem

3D & Surface

contour · contour3 · contourf · mesh · meshc · plot3 · quiver · scatter3 · surf · surfc

Images

image · imagesc · imshow

Axes & Layout

axis · box · grid · sgtitle · subplot · title · view · zlabel

Appearance

colorbar · colormap · legend · shading

Handle Access

gca · gcf · get · set

Other

addpoints · ancestor · animatedline · autumn · axes · barh · bone · caxis · cla · clf · clim · colorcube · colororder · cool · copper · copyobj · daspect · datacursormode · dataTipTextRow · drawnow · fcontour · figure · fill · fill3 · findobj · fsurf · gobjects · gray · groot · hgload · hgsave · hidden · histogram2 · hold · hot · inferno · isgraphics · ishandle · jet · line · lines · linkaxes · magma · openfig · opengl · pan · parula · patch · pink · plasma · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · spring · stackedplot · subtitle · summer · suptitle · text · textscatter · textscatter3 · triplot · turbo · viridis · waitbar · winter · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom

Source you can read

Every RunMat function's source is public. Read exactly how cylinder is executed, line by line, in Rust.

  • View the source for cylinder in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Coordinates and shapes
  • Plot forms and placement
  • Examples
  • Construct tapered cylinder coordinates
  • Plot the default unit cylinder
  • Using cylinder with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • Source you can read
  • About RunMat