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
    • isvarname
    • mustBeA
    • mustBeColumn
    • mustBeFile
    • mustBeFinite
    • mustBeFloat
    • mustBeFolder
    • mustBeGreaterThan
    • mustBeGreaterThanOrEqual
    • mustBeInRange
    • mustBeInteger
    • mustBeLessThan
    • mustBeLessThanOrEqual
    • mustBeMember
    • mustBeNegative
    • mustBeNonempty
    • mustBeNonmissing
    • mustBeNonNan
    • mustBeNonnegative
    • mustBeNonpositive
    • mustBeNonsparse
    • mustBeNonzero
    • mustBeNonzeroLengthText
    • mustBeNumeric
    • mustBeNumericOrLogical
    • mustBePositive
    • mustBeReal
    • mustBeScalarOrEmpty
    • mustBeSparse
    • mustBeText
    • mustBeTextScalar
    • mustBeUnderlyingType
    • mustBeValidVariableName
    • mustBeVector
    • namedargs2cell
    • validateFunctionSignaturesJSON

mustBeLessThan — Validate that numeric values are less than a threshold.

mustBeLessThan is available as a callable MATLAB argument validator. It returns no user-facing value when validation passes and throws a structured RunMat error when validation fails. Validators with literal/static payloads are also encoded in MATLAB arguments blocks; dynamic validator payload expressions should call the validator directly until runtime-evaluated arguments-block payloads are implemented. Integer inputs are validated or rejected from their exact class and values. Resident metadata is validated before any provider access, automatic residency remains transparent, and unsupported explicit gpuArray forms are compatibility-gated before download.

Syntax

mustBeLessThan(A, bound)

Inputs

A
Type
Any
Required
Yes
Description
Value to validate or inspect.
bound
Type
Any
Required
Yes
Description
Comparison or membership operand; exact storage is preserved.
NameTypeRequiredDefaultDescription
AAnyYes—Value to validate or inspect.
boundAnyYes—Comparison or membership operand; exact storage is preserved.

Errors

RunMat:mustBeLessThan:TooManyOutputs
When
An output is explicitly requested.
Message
mustBeLessThan: too many output arguments
RunMat:mustBeLessThan:InvalidArgument
When
Input count, class, shape or control admission fails.
Message
mustBeLessThan: invalid argument
RunMat:mustBeLessThan:ValidationFailed
When
The supplied value does not satisfy this validator.
Message
mustBeLessThan: value does not satisfy validator
IdentifierWhenMessage
RunMat:mustBeLessThan:TooManyOutputsAn output is explicitly requested.mustBeLessThan: too many output arguments
RunMat:mustBeLessThan:InvalidArgumentInput count, class, shape or control admission fails.mustBeLessThan: invalid argument
RunMat:mustBeLessThan:ValidationFailedThe supplied value does not satisfy this validator.mustBeLessThan: value does not satisfy validator
RunMat:argumentValidation:InvalidArgumentThe shared validator text-control parser receives a non-text payload.argumentValidation: expected text
RunMat:validators:ProviderOwnershipMismatchA resident value has no exact owning provider.argument validation: no acceleration provider owns the input
RunMat:validators:ProviderPayloadMismatchA resident value carries contradictory physical class metadata.argument validation: resident input has contradictory physical class metadata
RunMat:gpu:DownloadFailedThe exact owning provider cannot download admitted numeric content.gpu download failed
RunMat:gpu:ProviderPayloadMismatchDownloaded class, shape, or storage contradicts the borrowed source metadata.gpu download payload mismatch

Behavior

Callable validator forms enforce exact supported arity, throw on validation failure, and suppress automatic output on success.

Arguments-block validation uses the same shared runtime predicates for validators that RunMat can encode statically.

Numeric validators check every element without materializing a cloned numeric array, including sparse stored values and implicit sparse zeros where relevant.

Text validators accept string scalars/arrays, character row vectors, and compatible cell arrays of text where MATLAB commonly permits them.

All eight integer classes are classified from authoritative storage; exact ordering, range, membership, sign, zero, finiteness, and missingness checks never reconstruct wide values from binary64.

Resident validation verifies owner, physical storage, precision, logical/integer class, and wrapper provenance before using metadata or downloading exact content.

Automatic residency remains transparent; explicit gpuArray input is accepted only for documented forms or a declared RunMat-only extension.

Residency and provider behavior

Validation uses coherent resident metadata when the result is type- or shape-decidable; content-dependent checks download exact typed values through the owning provider without changing source residency.

Metadata-decidable validators avoid download. Content-dependent validators use a non-destructive exact-owner download and leave the source handle, class, payload, and provenance unchanged.

Validation does not use the generic message-based gather retry path. Integrity and compatibility failures are terminal; admitted content checks download typed storage deliberately through the exact owning provider.

Execution and service boundaries

This validator has zero public outputs. Statements and arguments-block checks validate normally; assigning a result rejects before provider or filesystem work.

Content-dependent resident checks use the existing exact-owner, typed, non-destructive download service. Metadata-decidable integer/logical cases avoid downloads. No validator device kernels or automatic uploads are used.

NaN and missingness checks traverse owned cells, not object references. The mustBeNonNan explicit-resident extension applies to nested resident values before downloads; mustBeNonmissing has no such extension.

Example

Using the validator as a normal callable guard

A = uint64(7);
mustBeLessThan(A, uint64(9));
passed = true;

Expected output:

No output when validation passes; an error is thrown when validation fails.

Using mustBeLessThan with coding agents

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

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

FAQ

Does this validator work in an arguments block?⌄

Yes for literal/static validator payloads that RunMat can encode at compile time. Dynamic validator payload expressions should use the callable form for now.

Related Argument Validation functions

isvarname · mustBeA · mustBeColumn · mustBeFile · mustBeFinite · mustBeFloat · mustBeFolder · mustBeGreaterThan · mustBeGreaterThanOrEqual · mustBeInRange · mustBeInteger · mustBeLessThanOrEqual · mustBeMember · mustBeNegative · mustBeNonempty · mustBeNonmissing · mustBeNonNan · mustBeNonnegative · mustBeNonpositive · mustBeNonsparse · mustBeNonzero · mustBeNonzeroLengthText · mustBeNumeric · mustBeNumericOrLogical · mustBePositive · mustBeReal · mustBeScalarOrEmpty · mustBeSparse · mustBeText · mustBeTextScalar · mustBeUnderlyingType · mustBeValidVariableName · mustBeVector · namedargs2cell · validateFunctionSignaturesJSON

Source you can read

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

  • View the source for mustBeLessThan 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
  • Errors
  • Behavior
  • Residency and provider behavior
  • Execution and service boundaries
  • Example
  • Using the validator as a normal callable guard
  • Using mustBeLessThan with coding agents
  • FAQ
  • Related Argument Validation functions
  • Source you can read
  • About RunMat