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
    • colon
    • createArray
    • empty
    • eye
    • false
    • full
    • inf
    • int16.empty
    • int32.empty
    • int64.empty
    • int8.empty
    • linspace
    • logspace
    • magic
    • meshgrid
    • nan
    • ndgrid
    • nonzeros
    • ones
    • peaks
    • rand
    • randi
    • randn
    • randperm
    • range
    • sparse
    • spdiags
    • speye
    • spones
    • sprand
    • true
    • uint16.empty
    • uint32.empty
    • uint64.empty
    • uint8.empty
    • zeros

uint8.empty — Create an empty uint8 array.

The uint8 class receiver selects exact host storage. Dimension controls determine the empty shape, not the output class.

Syntax

A = ClassName.empty
A = ClassName.empty(sz1, ..., szN)
A = ClassName.empty(sizeVector)

Inputs

dimensions
Type
SizeArg
Required
Variadic
Default
—
Description
Integer scalar dimensions; at least one dimension must be zero.
sizeVector
Type
SizeArg
Required
Yes
Default
—
Description
Row vector of integer dimensions; at least one dimension must be zero.
NameTypeRequiredDefaultDescription
dimensionsSizeArgVariadic—Integer scalar dimensions; at least one dimension must be zero.
sizeVectorSizeArgYes—Row vector of integer dimensions; at least one dimension must be zero.

Returns

A
Type
Any
Description
Empty array preserving the receiver class.
NameTypeDescription
AAnyEmpty array preserving the receiver class.

Errors

RunMat:empty:InvalidSize
When
Size arguments are not integer-valued numeric scalars or one row size vector.
Message
empty: invalid size arguments
RunMat:empty:NonEmptyShape
When
Every normalized dimension is nonzero.
Message
empty: at least one dimension must be zero
RunMat:empty:UnsupportedClass
When
The selected shorthand class cannot be represented as a shaped empty value.
Message
empty: unsupported output class
IdentifierWhenMessage
RunMat:empty:InvalidSizeSize arguments are not integer-valued numeric scalars or one row size vector.empty: invalid size arguments
RunMat:empty:NonEmptyShapeEvery normalized dimension is nonzero.empty: at least one dimension must be zero
RunMat:empty:UnsupportedClassThe selected shorthand class cannot be represented as a shaped empty value.empty: unsupported output class
RunMat:empty:InternalThe empty value cannot be assembled.empty: internal error
RunMat:empty:TooManyOutputsMore than one output is requested.empty: too many output arguments

Behavior

RunMat registers class-qualified forms for int8.empty, int16.empty, int32.empty, int64.empty, uint8.empty, uint16.empty, uint32.empty, and uint64.empty.

All eight integer classes are accepted for scalar dimension controls and row size vectors. Values are decoded from authoritative integer storage without conversion through double.

Signed negative dimensions become zero. Nonnegative dimensions must be integer-valued and within the platform size range.

A single scalar dimension requests a square shape. A size-vector argument must be a row vector; column vectors reject.

Trailing singleton dimensions after dimension two are removed. At least one remaining dimension must be zero.

Integer outputs contain exact empty IntegerStorage of the receiver class.

The global empty(...) shorthand and its trailing typename selector are RunMat-only extensions. MATLAB-compatible mode requires class-qualified syntax.

The former global "like" shorthand is not retained because it did not inherit output class and is not part of the documented class-static surface.

User-defined and general object-class empty arrays require broader class-array storage and static-method dispatch support.

GPU residency and provider behavior

Integer class-static forms construct host empty storage. Resident numeric size controls are accepted only in RunMat mode and reject before provider access when extensions are disabled.

Primitive integer ClassName.empty forms construct exact host integer storage. A resident size control is a compatibility-gated RunMat extension and is gathered only after validation and gating.

Syntax

A = ClassName.empty

A = ClassName.empty(sz1, ..., szN)

A = ClassName.empty(sizeVector)

At least one normalized dimension must be zero.

A size vector must be a row vector.

Signed negative dimensions are treated as zero.

Trailing singleton dimensions after dimension two are omitted.

Examples

Create an empty uint8 matrix

A = uint8.empty(0, 5);

Preserve a normalized N-D empty shape

A = uint8.empty(int32([0 2 3 1]));

Using uint8.empty with coding agents

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

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

FAQ

Does the class come from a size argument?⌄

No. In MATLAB-compatible syntax the receiver in ClassName.empty determines the output class. Integer size arguments are structural controls only.

Are wide uint64 dimensions converted through double?⌄

No. Host integer controls are decoded exactly from integer storage and checked against the platform size range.

Can empty create a nonempty array?⌄

No. After signed-negative clamping and trailing-singleton normalization, at least one dimension must be zero.

Can I call empty as a global function?⌄

Only in RunMat mode. The global shorthand is explicitly compatibility-gated; portable MATLAB-compatible code uses ClassName.empty.

Related Array functions

Creation

colon · createArray · empty · eye · false · full · inf · int16.empty · int32.empty · int64.empty · int8.empty · linspace · logspace · magic · meshgrid · nan · ndgrid · nonzeros · ones · peaks · rand · randi · randn · randperm · range · sparse · spdiags · speye · spones · sprand · true · uint16.empty · uint32.empty · uint64.empty · zeros

Accumulation

accumarray

Sorting Sets

argsort · intersect · ismember · ismembertol · issorted · issortedrows · setdiff · setxor · sort · sortrows · union · unique

Shape

blkdiag · cat · circshift · diag · flip · fliplr · flipud · horzcat · ipermute · kron · permute · repelem · repmat · reshape · rot90 · shiftdim · squeeze · toeplitz · tril · triu · vertcat

Combinatorics

combinations · nchoosek · perms

Binning

discretize

Indexing

find · ind2sub · sub2ind

Grouping

findgroups · groupcounts · grp2idx · splitapply

Introspection

height · iscolumn · isempty · ismatrix · isrow · isscalar · isvector · length · ndims · numel · size · width

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
  • Behavior
  • GPU residency and provider behavior
  • Syntax
  • Examples
  • Create an empty uint8 matrix
  • Preserve a normalized N-D empty shape
  • Using uint8.empty with coding agents
  • FAQ
  • Related Array functions
  • Creation
  • Accumulation
  • Sorting Sets
  • Shape
  • Combinatorics
  • Binning
  • Indexing
  • Grouping
  • Introspection
  • About RunMat