RunMat vs Python

RunMat runs MATLAB-language code, where matrix math reads the way it is written on paper and sizes are checked before the code runs. It uses any GPU and calls NumPy, SciPy and pandas when you need them. Python has the larger library collection, especially for machine learning.

  • Existing .m files run without a rewrite
  • 5 million-path Monte Carlo in 607 ms on the GPU, 79.9 s in NumPy
  • Size mismatches reported before the code runs
Download RunMat

Facts about Python checked November 6, 2026. Sources

gbm_option_price.m
% Price a European call by Monte Carlo: 1,000,000 geometric
% Brownian motion paths over 256 daily steps.
rng(0);
M = 1000000; T = 256;
S0 = single(100); mu = single(0.05); sigma = single(0.20);
dt = single(1/252); K = single(100);
S = ones(M, 1, 'single') * S0;
drift = (mu - 0.5 * sigma^2) * dt;
scale = sigma * sqrt(dt);
for t = 1:T
Z = randn(M, 1, 'single');
S = S .* exp(drift + scale .* Z);
end
payoff = max(S - K, 0);
price = mean(payoff, 'all') * exp(-mu * T * dt);
fprintf('Call price: %.4f\n', price);
fprintf('Paths in the money: %.1f%%\n', 100 * mean(S > K));

Printed Call price: 10.5478 · Paths in the money: 56.0%

The same option priced by Monte Carlo in each language. Black–Scholes gives 10.5521; RunMat's run is 0.04% from it and NumPy's 0.08%, which is sampling noise from different random streams.

At a glance

Language
RunMatMATLAB language: matrices are the default type, indexing starts at 1, and math reads close to the page.
PythonPython, a general-purpose language. Arrays come from NumPy, which indexes from 0.
Code you already have
RunMatMATLAB scripts and functions run as they are.
PythonMATLAB code is rewritten, and its results checked again against the original.
Size and type checks
RunMatMismatched matrix sizes, operand types, argument counts and unknown functions reported before the code runs, in the editor and with runmat check.
PythonArray sizes are checked when each line runs. mypy and pyright check names and annotated types [1][2]; they passed the shape bug shown on this page.
Libraries
RunMat2,100+ built-in functions in one runtime, plus any Python package called from MATLAB code.
PythonNumPy, SciPy, pandas, Matplotlib and a very large package collection, including the main machine learning frameworks [3][4].
GPU
RunMatNVIDIA, AMD, Intel and Apple GPUs, with the same code that runs on the CPU.
PythonCode reaches the GPU only when it is rewritten for a GPU array library such as PyTorch or CuPy, each with its own array type and supported hardware [5][6].
Speed, Monte Carlo
RunMat5 million paths: 607 ms on the GPU (Apple M2 Max).
PythonNumPy on the CPU: 79.9 s. PyTorch on the GPU: 1,698 ms.
Setup
RunMatOne installer for desktop and CLI, or the browser with nothing to install.
PythonPython plus packages from pip or conda, usually in a virtual environment per project, set up again on each machine [7].
Shipping a program
RunMatrunmat compile builds a standalone native executable from a MATLAB program.
PythonSeveral routes, from packages and bundled applications to containers, chosen per target [8].
Simulation
RunMatBuilt in: structural, thermal, electromagnetic, acoustic, fluid and coupled studies on STEP geometry.
PythonNone built in. Finite element libraries such as FEniCS have you write the weak form of the equations in code [9].
Collaboration and multiplayer
RunMatLive co-editing with cursors in code, plots and 3D results; every run kept with its inputs.
PythonJupyter notebooks [10] and Git. Live co-editing needs a hosted notebook service.
Price
RunMatFree for individuals, academics, open-source contributors and smaller organizations. Professional license: $99 per person per month in the US, or the local equivalent.
PythonFree and open source; NumPy and SciPy are BSD-licensed [3][4].

The same engineering math in both languages

In the MATLAB language the matrix is the basic value. Matrices are written as literals, operators work on whole matrices, and the common linear-algebra steps are operators: \ to solve, ' to transpose. Code reviewed against a derivation reads line for line like the derivation.

Each task below was run in RunMat and in Python with NumPy on November 4, 2026, and shows what each printed. Python has its own advantages: explicit imports make it clear where every function in a large program comes from, and x[-3:] is as short as x(end-2:end).

The matrix is typed the way it is written on paper, with spaces between columns and semicolons between rows. A \ b solves the system without forming the inverse. NumPy builds the matrix from a list of rows inside np.array, and the solve is a library call [11].

MATLAB in RunMat

solve.m
A = [4 -2 1; -2 4 -2; 1 -2 4];
b = [11; -16; 17];
x = A \ b
Output
$ runmat solve.m
x =
1.0000
-2.0000
3.0000

Python with NumPy

solve.py
import numpy as np
A = np.array([[4, -2, 1], [-2, 4, -2], [1, -2, 4]])
b = np.array([11, -16, 17])
x = np.linalg.solve(A, b)
print(x)
Output
$ python solve.py
[ 1. -2. 3.]

Size mistakes found before the code runs

RunMat works out the size and type of each value before the code runs. It reports matrix products, solves, elementwise operations and concatenations whose sizes cannot agree, calls with the wrong number of arguments and functions that are not defined anywhere in the project. The editor shows these as you type, and runmat check runs the same checks in CI.

Here 100 measured points are stored one per row, and the rotation treats them as columns. RunMat reports line 5 with its error code before anything runs.

The NumPy version passes mypy and pyright, the two standard Python type checkers. They check names and annotated types, and leave array sizes to NumPy, which raises the error when line 8 runs, after every line above it has run. In a long analysis, that can be hours after the run started.

Simulation studies get the same treatment: every number in a .fea study carries a unit, and a traction written in newtons is refused before anything meshes. See Simulation.

RunMat

rotate_points.m
% Rotate 100 measured points by 30 degrees
theta = pi/6;
R = [cos(theta) -sin(theta); sin(theta) cos(theta)];
P = rand(100, 2); % one point per row
Q = R * P; % should be R * P'
plot(Q(1, :), Q(2, :), 'o')
Terminal
$ runmat check rotate_points.m
error[RM-TYPE-MATMUL]: matrix inner dimensions 2 and 100 do not agree
--> rotate_points.m:5:1
|
5 | Q = R * P; % should be R * P'
| ^^^^^^^^^ static value contract is not satisfied here
checked rotate_points.m: 1 error(s), 0 warning(s)

Python with NumPy

rotate_points.py
# Rotate 100 measured points by 30 degrees
import numpy as np
import matplotlib.pyplot as plt
theta = np.pi / 6
R = np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]])
P = np.random.rand(100, 2) # one point per row
Q = R @ P # should be R @ P.T
plt.plot(Q[0, :], Q[1, :], "o")
Terminal
$ mypy --strict rotate_points.py
Success: no issues found in 1 source file
$ pyright rotate_points.py
0 errors, 0 warnings, 0 informations
$ python rotate_points.py
Traceback (most recent call last):
File "rotate_points.py", line 8, in <module>
Q = R @ P # should be R @ P.T
~~^~~
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 100 is different from 2)

Captured November 4, 2026 with the RunMat CLI, Python 3.13 with NumPy 2.5, mypy 2.4 (--strict) and pyright 1.1. The traceback's directory path is shortened to the file name.

Run the same work on the GPU

The published Monte Carlo benchmark runs this computation at five sizes. RunMat moves the arrays to the GPU, fuses the elementwise update in the loop and keeps the prices on the device for all 256 steps.

NumPy runs the same loop on the CPU, one operation at a time. PyTorch reaches the GPU when the code is written against its tensor type. The source for all three, and the harness that times them, is in the RunMat repository.

Monte Carlo option pricing, 256 steps · median wall time

PathsRunMat (GPU)PyTorch (GPU)NumPy (CPU)
250,000109 ms824 ms4,066 ms
500,000136 ms900 ms8,207 ms
1,000,000188 ms894 ms16,092 ms
2,000,000298 ms1,109 ms32,305 ms
5,000,000607 ms1,698 ms79,895 ms

Apple M2 Max, run 2025-11-21. Source and harness in the RunMat repository.

What you can do in RunMat

The numerical work engineers bring to Python, written in MATLAB syntax and run on the CPU or the GPU.

Analyze data

  • Tables, timetables, dates and missing values
  • Statistics, fitting and optimization
  • Signal processing and FFTs
  • CSV, Excel, .mat and binary files

Math in RunMat

Run it fast

  • Automatic GPU placement and fusion
  • parfor across every core
  • The same script on a cluster
  • Compiled standalone executables

GPU

Call Python

  • Import NumPy, SciPy, pandas and your own modules
  • Large arrays passed to NumPy without a copy
  • Java classes and C libraries too
  • MEX files rebuilt without MATLAB

Interop

Plot

  • 2D and 3D figures rendered on the GPU
  • Pan, zoom and rotate in the browser
  • Subplots, annotations and colormaps
  • Figures saved with the run

Plotting

Simulate

  • Studies written as text with units
  • STEP geometry meshed in the study
  • Coupled thermal and structural analyses
  • Sweeps driven from a script

Simulation

Work together and with AI

  • Live co-editing in one project
  • The built-in agent writes and runs code
  • Claude Code, Codex and MCP clients
  • Run history with inputs and version

AI integrations

When RunMat is the better choice

RunMat is the better choice when the work is engineering math and the people doing it think in matrices.

  • The team has MATLAB code and MATLAB-trained engineers. The code runs as it is, and nobody has to re-verify a port.

    MATLAB compatibility

  • The math is linear algebra, signals or control, and reviewers should be able to read the code against the equations in the report.

    Linear algebra

  • Size mistakes are expensive to find late, in a long run or a script someone else wrote. RunMat reports them before the run starts.

    Static analysis

  • You want the GPU without rewriting code for PyTorch or CuPy, on whatever GPU the machine has.

    GPU

  • Engineers need to share and co-edit analyses live, in the browser or on the desktop, with no environment to set up.

    Desktop and browser

  • The analysis feeds a simulation: RunMat runs structural, thermal and electromagnetic studies on STEP geometry in the same project.

    Simulation

When Python is the better choice

  • Training and serving machine learning models with PyTorch, JAX or similar frameworks.
  • Web services, data pipelines and production software already written in Python.
  • A team that writes Python today and has no MATLAB code to keep.
  • A field whose standard packages exist only in Python. RunMat can call many of them, but a pure Python project stays simpler.
  • A policy that every tool be under an OSI-approved open-source license. RunMat's source is public under the Business Source License, which is not OSI-approved.
  • Elementwise math on small arrays on the CPU, where NumPy is fast: 1 million points take 72 ms in NumPy and 145 ms in RunMat, which pays a fixed GPU launch cost (Apple M2 Max).

Your MATLAB code works with the rest of RunMat

  • With simulation

    Write a study's loads and boundary conditions as MATLAB functions, sweep its inputs from a script and read every result back as arrays, in the same project.

    Simulation
  • With MCAD

    Drive a part's dimensions from MATLAB code, such as a cam profile from its motion law, and compare the stress study for each design.

    MCAD
  • With ECAD

    Compute part values in MATLAB code, such as a filter's resistors and capacitors from its cutoff, and run the circuit's sweeps against its spec.

    ECAD

Keep the code, add Python where it helps

  1. 01

    Run your MATLAB code

    Open the folder of .m files in RunMat, in the browser or on the desktop, and run it.

    Install

  2. 02

    Call the Python you need

    Use py. to import a Python package from MATLAB code. Large arrays reach NumPy without a copy.

    Interop

  3. 03

    Port only if it pays

    If you still move a program to Python, RunMat's output from the original is the reference to check the port against.

    Migration guide

License

RunMat is source-available under the Business Source License 1.1, and each version converts to the Apache License 2.0 three years after the date it is first published.

The source code is available on GitHub, so you can read, build and modify the code that produces every result. Enterprise adds self-hosted deployment, including fully offline, under contract.

RunMat pricingLicenseSource codeWhy RunMat uses the BSL

Questions

01Is Python better than MATLAB for engineering?

It depends on the work. Python is stronger for machine learning, web services and general software. The MATLAB language is compact for matrix math, signal processing and control, and many engineering teams have years of code in it. RunMat runs that code and calls Python packages from it.

02Is MATLAB syntax easier to read than NumPy?

For matrix math, usually. Matrices are written as literals, A \ b solves a system, ' is the conjugate transpose and column vectors have a real shape, so code follows the equations closely. NumPy spells the same steps with np.array, np.linalg.solve and .conj().T, and one-dimensional arrays make v.T @ v and v @ v.T the same [11]. Python reads better for general programming outside the math.

03Does Python check array shapes before running?

No. NumPy checks sizes when each operation runs and raises a ValueError on a mismatch [12]. mypy and pyright check names and types, and both passed the shape bug on this page. RunMat reports mismatched matrix sizes, wrong argument counts and unknown functions before the code runs.

Static analysis

04Should I convert my MATLAB code to Python?

Convert when the program's future is in the Python ecosystem. Otherwise run it in RunMat and call Python packages where they help. If you do port, use RunMat's output from the original program as the reference to check the port against.

Interop

05Is RunMat faster than NumPy?

On the published Monte Carlo benchmark, 5 million paths took 607 ms in RunMat on the GPU and 79.9 s in NumPy on the CPU (Apple M2 Max). On small elementwise arrays NumPy is faster: 1 million points took 72 ms in NumPy and 145 ms in RunMat.

Benchmarks

06Can RunMat call Python packages?

Yes. MATLAB code in RunMat imports Python modules with py., including NumPy, SciPy, pandas and your own modules. Large arrays reach NumPy without being copied.

Interop

07Do I need a GPU library to use the GPU in RunMat?

No. RunMat moves array operations to the GPU when it estimates the GPU will be faster, on NVIDIA, AMD, Intel and Apple hardware, with the same code that runs on the CPU.

GPU

08Is RunMat open source like Python?

RunMat 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. RunMat is licensed under the Business Source License 1.1, and each version converts to Apache 2.0 three years after it is first published. The source code is available on GitHub. Python and NumPy are open source today.

LicenseSource code

Sources

We checked the facts about Python on this page against these sources on November 6, 2026.

  1. [1]mypy documentationmypy.readthedocs.io
  2. [2]Pyrightgithub.com
  3. [3]NumPynumpy.org
  4. [4]SciPyscipy.org
  5. [5]PyTorch, Get started (supported compute platforms)pytorch.org
  6. [6]CuPycupy.dev
  7. [7]Python documentation, Virtual environments and packagesdocs.python.org
  8. [8]Python Packaging User Guide, Overview of Python packagingpackaging.python.org
  9. [9]FEniCS Projectfenicsproject.org
  10. [10]Project Jupyterjupyter.org
  11. [11]NumPy documentation, NumPy for MATLAB usersnumpy.org
  12. [12]NumPy documentation, numpy.matmulnumpy.org
  13. [13]NumPy documentation, numpy.linalg.lstsqnumpy.org
  14. [14]Matplotlibmatplotlib.org