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
    • eq
    • ge
    • gt
    • isequal
    • isequaln
    • le
    • lt
    • ne

isequal — Test array equality in MATLAB and RunMat.

isequal(A, B, ...) returns one host logical scalar when all inputs match in shape and values. Numeric, logical and character values compare across classes with exact integer comparisons; strings compare as text. NaNs compare unequal, including recursively.

Syntax

tf = isequal(A, B, ...)

Inputs

A
Type
Any
Required
Yes
Description
First value.
B
Type
Any
Required
Yes
Description
Second value.
others
Type
Any
Required
Variadic
Description
Additional values compared against A.
NameTypeRequiredDefaultDescription
AAnyYes—First value.
BAnyYes—Second value.
othersAnyVariadic—Additional values compared against A.

Returns

tf
Type
LogicalArray
Description
Host logical scalar; numeric values compare across classes without lossy conversion.
NameTypeDescription
tfLogicalArrayHost logical scalar; numeric values compare across classes without lossy conversion.

Errors

RunMat:isequal:NotEnoughInputs
When
Fewer than two inputs are supplied.
Message
isequal: requires at least two input arguments
RunMat:isequal:Internal
When
Resident input ownership, payload validation, or download fails.
Message
isequal: internal error
RunMat:isequal:TooManyOutputs
When
More than one output is requested.
Message
isequal: too many output arguments
IdentifierWhenMessage
RunMat:isequal:NotEnoughInputsFewer than two inputs are supplied.isequal: requires at least two input arguments
RunMat:isequal:InternalResident input ownership, payload validation, or download fails.isequal: internal error
RunMat:isequal:TooManyOutputsMore than one output is requested.isequal: too many output arguments

Behavior

isequal(A, B) compares two values for equality.

isequal(A, B, C, ...) compares all inputs against each other; returns true only if all are equal.

Arrays must have identical shape (size) to be equal.

Numeric values compare across classes without lossy promotion of wide integers.

All corresponding elements must be identical for arrays to be equal.

NaN values are NOT equal to each other (NaN ~= NaN).

Empty arrays [] are equal to other empty arrays with the same shape.

Cell arrays are compared element-by-element recursively.

Structs are compared field-by-field.

Sparse values compare to full values, and real values compare to complex values when the imaginary component is zero.

Structs and struct arrays compare matching field names and values regardless of field insertion order.

Complex scalars and one-element complex arrays compare component values exactly across storage classes.

Nested cells, structs and struct arrays are compared recursively; unsupported object, callable, symbolic, foreign and other value kinds return false without invoking user code.

Zero requested outputs evaluates and discards the result; more than one output fails before any provider access. At least two inputs are required.

Placement and execution

All resident numeric leaves, including leaves in cells and structs, download through their exact owning provider with class, shape and payload validation. Inputs retain residency; the result is a host logical scalar. There is no device comparison or fusion kernel.

Distributed arguments require materialization before recursive comparison. The portable async runtime binding is shared by interpreter and compiled calls; downloads may suspend or fail. No callbacks, workspace, filesystem, randomness or time services are used. Transfer costs and scheduling belong to shared materialization services.

Examples

Compare structures independently of field order

left = struct('a', 1, 'b', 2);
right = struct('b', 2, 'a', 1);
tf = isequal(left, right)

Expected output:

tf = true

Comparing two identical scalars

tf = isequal(5, 5)

Expected output:

ans = logical
     1

Comparing two different scalars

tf = isequal(5, 6)

Expected output:

ans = logical
     0

Comparing identical matrices

A = [1 2; 3 4];
B = [1 2; 3 4];
tf = isequal(A, B)

Expected output:

ans = logical
     1

Comparing matrices with different shapes

A = [1 2 3];
B = [1; 2; 3];
tf = isequal(A, B)

Expected output:

ans = logical
     0

Comparing multiple arrays at once

tf = isequal([1 2], [1 2], [1 2])

Expected output:

ans = logical
     1

NaN values are not equal

tf = isequal(NaN, NaN)

Expected output:

ans = logical
     0

Verifying that every cell starts with []

C = cell(2, 2);
tf = isequal(C{1,1}, [], C{2,2}, [])

Expected output:

ans = logical
     1

Compare exact numeric values across classes

tf = isequal(uint64(255), int16(255), 255, single(255))

Expected output:

tf = true

Compare nested resident values without changing their residency

G = gpuArray(uint16([1 2]));
tf = isequal({G}, {uint16([1 2])})

Expected output:

tf = true

Using isequal with coding agents

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

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

FAQ

How is isequal different from ==?⌄

isequal returns a single logical value indicating whether all inputs are completely identical. The == operator performs element-wise comparison and returns an array of the same size as the inputs.

How does isequal handle NaN values?⌄

NaN values are NOT considered equal. isequal(NaN, NaN) returns false. Use isequaln if you want NaN values to be treated as equal.

Can I compare more than two arrays?⌄

Yes. isequal(A, B, C, ...) accepts any number of inputs and returns true only if all inputs are equal to each other.

Are empty arrays equal?⌄

Empty arrays with the same shape are equal. For example, isequal([], []) returns true, and isequal(zeros(0,3), zeros(0,3)) returns true.

How are cell arrays compared?⌄

Cell arrays are compared element-by-element. Each corresponding pair of cells must contain equal values for the cell arrays to be equal.

What happens with different data types?⌄

Numeric classes compare by exact value, including signed and unsigned integers, floating-point values, logical values and character codes. Values are not preconverted through double; other unlike value kinds return false.

Related Logical functions

Rel

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

Tests

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

Bit

and · not · or · xor

Logical

logical

Source you can read

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

  • View the source for isequal 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
  • Behavior
  • Placement and execution
  • Examples
  • Compare structures independently of field order
  • Comparing two identical scalars
  • Comparing two different scalars
  • Comparing identical matrices
  • Comparing matrices with different shapes
  • Comparing multiple arrays at once
  • NaN values are not equal
  • Verifying that every cell starts with []
  • Compare exact numeric values across classes
  • Compare nested resident values without changing their residency
  • Using isequal with coding agents
  • FAQ
  • Related Logical functions
  • Rel
  • Tests
  • Bit
  • Logical
  • Source you can read
  • About RunMat