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
    • and
    • not
    • or
    • xor

not — Compute element-wise logical negation.

not(A) and ~A invert the zero/nonzero truth value of every supported element.

Syntax

tf = not(A)

Inputs

A
Type
Any
Required
Yes
Description
Logical, numeric, character, complex, table, or timetable input.
NameTypeRequiredDefaultDescription
AAnyYes—Logical, numeric, character, complex, table, or timetable input.

Returns

tf
Type
Any
Description
Logical negation with the input array shape or tabular container.
NameTypeDescription
tfAnyLogical negation with the input array shape or tabular container.

Errors

RunMat:not:InvalidInput
When
The input is not supported logical, numeric, character, complex, table, timetable, or resident numeric data.
Message
not: unsupported input type
IdentifierWhenMessage
RunMat:not:InvalidInputThe input is not supported logical, numeric, character, complex, table, timetable, or resident numeric data.not: unsupported input type

Truth and shape semantics

not(A) and ~A invert each element's zero/nonzero truth value. Zero becomes true; every nonzero numeric value, including NaN and a complex value with either component nonzero, becomes false.

All eight fixed-width integer classes are tested directly in authoritative storage. Array shape and empty geometry are preserved.

Tables and accelerated execution

Tables and timetables apply not independently to every supported variable and retain their container metadata.

A supported same-owner provider operation remains resident. Unsupported provider routes gather exactly; explicitly requested residency is restored only after validating owner, device, shape, storage, and aliasing.

Examples

Negate a scalar condition

tf = not(5)

Expected output:

tf = false

Invert a logical mask

tf = not(logical([1 0 1]))

Expected output:

tf = [false true false]

Invert numeric truth values

tf = not([0 1 NaN 0])

Expected output:

tf = [true false false true]

Evaluate wide integers exactly

x = [uint64(0) intmax('uint64')];
tf = not(x)

Expected output:

tf = [true false]

Invert character code points

tf = not(['A' 0 'C'])

Expected output:

tf = [false true false]

Invert complex truth values

tf = not([0+0i 1+0i 0+2i])

Expected output:

tf = [true false false]

Invert table variables

T = table([0; 2], [1; 0], 'VariableNames', {'A', 'B'});
R = not(T)

Expected output:

R is a table with logical variables

Keep a supported result resident

A = gpuArray([0 2 0]);
G = not(A);
tf = gather(G)

Expected output:

G remains resident and tf = [true false true]

Using not with coding agents

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

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

FAQ

What does not return?⌄

A scalar operand produces a logical scalar; an array produces a logical array; a tabular operand retains its table or timetable container with logical variables.

How are NaN and complex values interpreted?⌄

NaN is nonzero. A complex value is true when either component is nonzero. not returns false for either case.

What happens to empty arrays?⌄

The result is an empty logical array with the same shape.

Are integers converted to double?⌄

No. Integer zero/nonzero truth is read directly from each fixed-width class.

How are tables handled?⌄

The operation is applied variable by variable and retains the table or timetable class and metadata.

Can execution remain on a GPU?⌄

Yes when an exact owning provider supports logical negation. Exact fallback preserves explicit gpuArray intent after validating the restored result.

Related Logical functions

Bit

and · or · xor

Tests

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

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 not is executed, line by line, in Rust.

  • View the source for not 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
  • Truth and shape semantics
  • Tables and accelerated execution
  • Examples
  • Negate a scalar condition
  • Invert a logical mask
  • Invert numeric truth values
  • Evaluate wide integers exactly
  • Invert character code points
  • Invert complex truth values
  • Invert table variables
  • Keep a supported result resident
  • Using not with coding agents
  • FAQ
  • Related Logical functions
  • Bit
  • Tests
  • Rel
  • Logical
  • Source you can read
  • About RunMat