isequaln — Test array equality while treating NaN values as equal.

isequaln(A, B, ...) returns true when every input has matching shape, compatible class, and equal contents, with NaN values considered equal.

Syntax

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

Inputs

NameTypeRequiredDefaultDescription
AAnyVariadicValues to compare (at least two).

Returns

NameTypeDescription
tfLogicalArrayTrue when all inputs are equal in size, class, and content.

Errors

IdentifierWhenMessage
RunMat:isequal:NotEnoughInputsFewer than two arguments are supplied.isequal: requires at least two input arguments
RunMat:isequal:InternalInternal gather/host normalization fails.isequal: internal error

How isequaln works

  • Accepts two or more inputs and compares every input against the first.
  • Treats NaN values as equal, including inside numeric arrays, complex values, cells, and structs.
  • Requires arrays to have identical shape.
  • Compares cell arrays and structs recursively.
  • Returns a scalar logical value.

Does RunMat run isequaln on the GPU?

isequaln does not currently execute comparison on device; it gathers GPU tensors before comparing values recursively.

GPU memory and residency

GPU inputs are gathered to host and the result is a host logical scalar.

Examples

Comparing NaN values

isequaln(NaN, NaN)

Expected output:

ans = logical
     1

Comparing arrays recursively

isequaln({[1 NaN]}, {[1 NaN]})

Expected output:

ans = logical
     1

Using isequaln with coding agents

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

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

FAQ

How is isequaln different from isequal?

isequaln treats NaN values as equal. isequal returns false when corresponding values are both NaN.

Rel

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

Bit

and · bitand · bitor · bitshift · not · or · xor

Logical

logical

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how isequaln is executed, line by line, in Rust.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 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.