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
    • allfinite
    • iscell
    • iscellstr
    • isfinite
    • isgpuarray
    • isinf
    • islogical
    • isnan
    • isnumeric
    • isreal
    • issparse
    • isstruct

isfinite — Determine which array elements are finite.

isfinite returns a same-shaped logical mask that distinguishes finite real or complex values from infinities and NaNs.

Syntax

tf = isfinite(A)

Inputs

A
Type
Any
Required
Yes
Description
Numeric, logical, character, or string input to classify element by element.
NameTypeRequiredDefaultDescription
AAnyYes—Numeric, logical, character, or string input to classify element by element.

Returns

tf
Type
LogicalArray
Description
Same-shaped logical mask that is true where both numeric components are finite.
NameTypeDescription
tfLogicalArraySame-shaped logical mask that is true where both numeric components are finite.

Errors

RunMat:isfinite:InvalidInput
When
Input is sparse or is not numeric, logical, character, or string data.
Message
isfinite: invalid input
RunMat:isfinite:InternalError
When
Internal mask construction, provider execution, or residency restoration fails.
Message
isfinite: internal error
RunMat:isfinite:TooManyOutputs
When
More than one output is requested.
Message
isfinite: too many output arguments
IdentifierWhenMessage
RunMat:isfinite:InvalidInputInput is sparse or is not numeric, logical, character, or string data.isfinite: invalid input
RunMat:isfinite:InternalErrorInternal mask construction, provider execution, or residency restoration fails.isfinite: internal error
RunMat:isfinite:TooManyOutputsMore than one output is requested.isfinite: too many output arguments

Values and classes

isfinite(A) returns a logical value for every element of A. Real values are true unless they are NaN, positive infinity, or negative infinity. A complex element is true only when both components are finite.

All fixed-width integers and logical values are finite by construction. Character elements are finite Unicode code points. String scalars return false and string arrays produce same-shaped false masks. Sparse and unrelated container values are rejected.

Shape, residency, and fusion

The output has the same shape as the input. Scalar input returns a logical scalar; nonscalar and empty input returns a logical array with the original dimensions.

A resident floating input uses its exact provider's logical_isfinite operation when available. A typed unsupported result falls back through one class-preserving transfer and restores the logical mask to the same owner. Integer input can produce the constant mask from class and shape alone. Compatible elementwise expressions may fuse.

Examples

Classify a finite scalar

tf = isfinite(42)

Expected output:

tf = true

Build a finite-value mask

A = [1 NaN; Inf 4];
tf = isfinite(A)

Expected output:

tf = [true false; false true]

Require both complex components to be finite

Z = complex([1 Inf NaN], [2 0 3]);
tf = isfinite(Z)

Expected output:

tf = [true false false]

Classify character code points

tf = isfinite(['R' 'u' 'n'])

Expected output:

tf = [true true true]

Classify fixed-width integers exactly

A = [uint64(0), uint64(9007199254740992) + uint64(1), intmax('uint64')];
tf = isfinite(A)

Expected output:

tf = [true true true]

Keep a logical mask resident

A = gpuArray(single([1 -Inf NaN]));
gtf = isfinite(A);
tf = gather(gtf)

Expected output:

gtf remains a gpuArray and tf = [true false false]

Using isfinite with coding agents

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

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

FAQ

Do NaN and infinity count as finite?⌄

No. Use isnan and isinf when the two cases need to be distinguished.

How are complex values classified?⌄

An element is finite only when both its real and imaginary components are finite.

How are logical, character, and string values classified?⌄

Logical values and character code points are finite. String scalars return false, and string arrays produce same-shaped false masks.

Are integer values converted to floating point?⌄

No. Every fixed-width integer is finite, so RunMat builds the logical mask directly from the exact class and shape.

Does a gpuArray input gather?⌄

The owning provider is used when it implements the operation. A typed unsupported response uses a class-preserving fallback and restores residency.

Can isfinite participate in a fused expression?⌄

Yes. The placement and fusion planner can combine compatible elementwise work when the selected provider supports the complete region.

Related Logical functions

Tests

allfinite · iscell · iscellstr · isgpuarray · isinf · islogical · isnan · isnumeric · isreal · issparse · isstruct

Bit

and · not · or · xor

Rel

eq · ge · gt · isequal · isequaln · le · lt · ne

Logical

logical

Source you can read

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

  • View the source for isfinite 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
  • Values and classes
  • Shape, residency, and fusion
  • Examples
  • Classify a finite scalar
  • Build a finite-value mask
  • Require both complex components to be finite
  • Classify character code points
  • Classify fixed-width integers exactly
  • Keep a logical mask resident
  • Using isfinite with coding agents
  • FAQ
  • Related Logical functions
  • Tests
  • Bit
  • Rel
  • Logical
  • Source you can read
  • About RunMat