RunMat
GitHub

MATLAB Compatibility

RunMat is a high-performance runtime for MATLAB code. It supports ~99% of core MATLAB language syntax, 330+ built-in functions, and full classdef OOP — with automatic GPU acceleration across all major vendors. No license required.

This page summarizes what works, what doesn't, and where to look for details. For the full feature-by-feature matrix, see Language Coverage. For individual functions, see the Built-in Function Reference.

Language coverage

RunMat targets MATLAB's core language grammar and semantics. Engineers familiar with MATLAB can be productive immediately — no new language to learn.

CategoryStatusHighlights
Variables & data typesdouble, single, char arrays, string arrays, logicals, integers (int8uint64), complex numbers, global, persistent
OperatorsArithmetic, element-wise, relational, logical (element-wise and short-circuit), transpose (' and .'), colon ranges
Control flowif/elseif/else, for, while, switch/case/otherwise, break, continue, return, try/catch/end, rethrow
FunctionsNamed functions, multiple returns ([a,b]=f()), anonymous functions with closures, varargin/varargout, nargin/nargout
Indexing & slicingN-D numeric indexing, logical indexing, end arithmetic, struct field access, cell content indexing, function/cell expansion into slice targets
OOP (classdef)Properties (including Dependent), methods (static/instance), events (addlistener/notify), handle classes, enumerations, operator overloading, metaclass operator ?Class
Packages & importsimport pkg.*, import pkg.name, MATLAB-parity precedence (locals > user > specific > wildcard > Class.*)
Scripting & syntax.m scripts, % and %{ %} comments, line continuation ..., semicolon suppression, command-form calls
ExceptionsMException with MATLAB-compatible identifiers and messages across indexing, arity, and OOP error paths

Full details: Language Coverage

Built-in functions

RunMat includes 330+ core MATLAB built-in functions covering math, linear algebra, array creation and manipulation, string operations, file I/O, and more. Notable additions include peaks (GPU-accelerated), clear/clc/close all session management, and full mldivide (backslash) linear system solving.

Browse the complete list: Built-in Function Reference

Plotting

RunMat includes 40+ plotting builtins with GPU-first rendering, interactive 3D camera, theming, and scene persistence.

2D chart types: plot, scatter, bar, histogram, hist, area, stairs, stem, errorbar, pie, contour, contourf, image, imagesc, quiver

3D chart types: plot3, surf, surfc, mesh, meshc, scatter3

Log-scale: semilogx, semilogy, loglog

Figure management: figure, subplot, hold, clf, cla, close, title, xlabel, ylabel, zlabel, legend, colorbar, colormap, axis, grid, box, shading, view, drawnow, pause

Handle graphics: get, set

Rendering is GPU-first: vertex buffers are built on-device and rendered through WebGPU in the browser or Metal/Vulkan/DX12 natively. Interactive 3D camera supports rotate, pan, and zoom with reversed-Z depth.

Advanced/specialized chart types (polar, heatmap, geobubble, wordcloud, stackedplot, swarmchart) and full annotation objects are not yet supported.

Toolbox coverage

RunMat focuses on core MATLAB — the language, operators, data types, and general-purpose built-in functions. MATLAB's add-on toolboxes are not included. Engineers whose workflows depend on specific toolboxes should check the table below.

MATLAB ToolboxRunMat StatusNotes
Core MATLAB~99% language, 330+ functions, full OOP, GPU
SimulinkRunMat is script-based only; no block-diagram modeling
Signal ProcessingNot implemented
Control SystemNot implemented
Image ProcessingBasic array ops and image/imagesc work on image data
Statistics & Machine LearningCore stats functions (mean, std, var, median, sort, hist, etc.) are available as builtins
OptimizationNot implemented
Symbolic MathNot implemented
Parallel Computing⚠️Different model — RunMat provides automatic GPU acceleration without explicit gpuArray or parfor

Compatibility modes

RunMat supports three compatibility modes, configured in .runmat:

  • compat = "runmat" (default) — accepts MATLAB command syntax (hold on, axis equal, etc.) with RunMat error namespaces
  • compat = "matlab" — same as runmat but error identifiers use MATLAB: prefix for closer parity
  • compat = "strict" — disables command-style implicit forms; all calls must use explicit parenthesized syntax

Details: Language Reference

Where RunMat goes beyond MATLAB

  • GPU-native tensor execution on any vendor (NVIDIA, AMD, Intel, Apple) via Metal, Vulkan, DirectX 12, and WebGPU — not CUDA-only
  • Automatic device planning and fusion — the runtime picks CPU vs GPU based on data size and fuses compatible operations into fewer kernels
  • Zero-temporary slice expansion — function/cell outputs write directly to destination slices without intermediate copies
  • Memory safety — Rust implementation eliminates entire classes of memory bugs
  • Browser-native — full IDE runs client-side via WebAssembly with no server, no login, no quotas
  • Built-in versioning — automatic per-save file history, snapshots, and git export without requiring engineers to learn git

Where RunMat goes beyond GNU Octave

  • Full classdef OOP (properties, methods, events, handle classes, enumerations, operator overloading, metaclass ?Class)
  • import pkg.* / import pkg.name with MATLAB-parity precedence
  • N-D end arithmetic across dimensions in both gather and scatter
  • Function/cell expansion into slice targets with dynamic packing
  • Uniform MException identifier/message model
  • Automatic GPU acceleration (Octave has no GPU support)
  • String arrays ("...") with MATLAB-parity indexing and comparison

Known limitations

  • No Simulink — RunMat is a script/function runtime, not a block-diagram simulation environment
  • No GUI frameworks — GUIDE and App Designer are not supported
  • No MATLAB toolboxes — Signal Processing, Control System, Image Processing, etc. are not included (see table above)
  • Plotting gaps — specialized chart types (polar, heatmap, etc.) and full Handle Graphics property coverage are still being added
  • File I/O — core functions (load, save, fopen, fclose, fprintf, fscanf, fread, fwrite, readmatrix, writematrix) are available; some advanced I/O functions are not yet implemented
  • MEX / Java / Python interop — not supported

Performance

RunMat uses a tiered execution model inspired by Google's V8: code starts running immediately in an interpreter, then hot paths are compiled into optimized machine code.

  • Monte Carlo (5M paths): ~2.8x faster than PyTorch, ~130x faster than NumPy
  • Elementwise chains (1B elements): ~100x+ faster than PyTorch when fusion eliminates memory traffic
  • Startup: ~5 ms via snapshot-based initialization

Full benchmark data: Benchmarks

Will my MATLAB code run in RunMat?

The fastest way to find out:

  1. Open the browser sandbox
  2. Paste your .m script
  3. Hit Run — no install, no account, no upload

Your code stays local. Nothing is sent to a server.

If something doesn't work, open an issue with a minimal reproducer and we'll add a conformance test.