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
    • cross
    • ctranspose
    • dot
    • mldivide
    • mpower
    • mrdivide
    • mtimes
    • pagemtimes
    • pagetranspose
    • trace
    • transpose

mrdivide — Solve linear systems with matrix right division.

mrdivide(A, B) is the callable form of A / B and solves X * B = A for scalar, square, rectangular, rank-deficient, complex, and supported provider-resident inputs.

Syntax

X = mrdivide(A, B)

Inputs

A
Type
Any
Required
Yes
Description
Left numeric, logical, character, complex, or provider-resident operand.
B
Type
Any
Required
Yes
Description
Right numeric, logical, character, complex, or provider-resident operand.
NameTypeRequiredDefaultDescription
AAnyYes—Left numeric, logical, character, complex, or provider-resident operand.
BAnyYes—Right numeric, logical, character, complex, or provider-resident operand.

Returns

C
Type
NumericArray
Description
Matrix-arithmetic result.
NameTypeDescription
CNumericArrayMatrix-arithmetic result.

Errors

RunMat:mrdivide:InvalidInput
When
Inputs are unsupported, are not matrices, or have incompatible dimensions.
Message
mrdivide: unsupported operand types
RunMat:mrdivide:Internal
When
The solver or acceleration provider cannot complete the operation correctly.
Message
mrdivide: internal runtime failure
IdentifierWhenMessage
RunMat:mrdivide:InvalidInputInputs are unsupported, are not matrices, or have incompatible dimensions.mrdivide: unsupported operand types
RunMat:mrdivide:InternalThe solver or acceleration provider cannot complete the operation correctly.mrdivide: internal runtime failure

Right division

X = A / B and mrdivide(A, B) solve X * B = A. Square, rectangular, and rank-deficient inputs use a minimum-norm least-squares solve.

Both inputs must behave as matrices, with trailing singleton dimensions allowed. Nonscalar inputs must have the same number of columns.

Classes and scalar forms

A real pair returns a real floating result; a complex operand promotes the solve to complex arithmetic. Logical matrices are converted to double.

When B is scalar, A / B scales A by 1/B. Fixed-width integers are supported only in this scalar-right form, where the integer class is preserved. Integer matrix solving is rejected.

Acceleration

A resident solve is offered to the exact provider that owns its inputs. Mixed-residency operands are uploaded only when their class and precision can be represented by that owner.

A typed unsupported-operation response permits host fallback. Provider failures and invalid output metadata are surfaced rather than silently changing execution paths.

Examples

Solve a square system

A = [1 2; 3 4];
B = [5 6; 7 8];
X = A / B;
R = X * B

Expected output:

R agrees with A

Compute a least-squares right division

A = [1 2 3];
B = [1 0 1; 0 1 1];
X = A / B

Expected output:

X = [1 2]

Divide by a scalar

A = [2 4 6];
X = A / 2

Expected output:

X = [1 2 3]

Solve with complex inputs

A = [1+2i 3-4i];
B = [2-i 1+i];
X = A / B;
R = X * B

Expected output:

R is the least-squares reconstruction

Using mrdivide with coding agents

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

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

FAQ

Why must A and B have the same number of columns?⌄

The equation X * B = A requires both matrices to describe the same output columns.

What happens for singular or rectangular B?⌄

RunMat computes a minimum-norm least-squares solution with singular-value decomposition.

Are higher-dimensional arrays supported?⌄

Inputs must be effective matrices. Trailing singleton dimensions are allowed; reshape other arrays before solving.

How are logical and integer arrays treated?⌄

Logical matrices become double. Integer values are accepted only for scalar-right division and preserve the integer class.

Will a resident result stay on its provider?⌄

Yes when the provider returns a valid result or the documented scalar fallback can restore it to the exact input owner.

Related Linalg functions

Ops

cross · ctranspose · dot · mldivide · mpower · mtimes · pagemtimes · pagetranspose · trace · transpose

Structure

bandwidth · isdiag · ishermitian · issymmetric · istril · istriu · symrcm

Factor

chol · decomposition · decomposition.ctranspose · decomposition.mldivide · decomposition.mrdivide · decomposition.mtimes · decomposition.rdivide · decomposition.subsref · decomposition.times · decomposition.uminus · decomposition.uplus · eig · eigs · gmres · ichol · ilu · lu · ordeig · ordqz · ordschur · pcg · qr · qz · rsf2csf · schur · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref · vecnorm

Source you can read

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

  • View the source for mrdivide 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
  • Right division
  • Classes and scalar forms
  • Acceleration
  • Examples
  • Solve a square system
  • Compute a least-squares right division
  • Divide by a scalar
  • Solve with complex inputs
  • Using mrdivide with coding agents
  • FAQ
  • Related Linalg functions
  • Ops
  • Structure
  • Factor
  • Solve
  • Source you can read
  • About RunMat