RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

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.

LicensePrivacy
/
See all docs
Builtin Reference
    • addpath
    • cd
    • copyfile
    • delete
    • dir
    • exist
    • fileattrib
    • fileparts
    • fullfile
    • genpath
    • getenv
    • getpref
    • isenv
    • isfile
    • isfolder
    • ispref
    • ls
    • matlabroot
    • memmapfile
    • mkdir
    • movefile
    • open
    • opentoline
    • path
    • pathsep
    • pcode
    • pwd
    • readstruct
    • rehash
    • restoredefaultpath
    • rmdir
    • rmpath
    • run
    • savepath
    • setenv
    • setpref
    • system
    • tempdir
    • tempname
    • uigetdir
    • uigetfile
    • uiputfile
    • unsetenv
    • userpath
    • what
    • winqueryreg
    • xmlread
    • xmlwrite

open — Open a file or variable using MATLAB-compatible dispatch.

open(name) resolves a workspace variable or file name using RunMat's MATLAB-style search path. MAT-files are loaded and returned as a struct, RunMat figure scene payloads return a figure handle, custom open<extension> handlers are invoked when available, and ordinary editor/viewer file types succeed with an empty result in noninteractive hosts.

Syntax

open name
A = open(name)

Inputs

NameTypeRequiredDefaultDescription
nameStringScalarYes—File or variable name to open.

Returns

NameTypeDescription
AAnyMAT-file contents, extension-handler output, figure handle, or empty array.

Returned values from open depend on how many outputs the caller requests.

Errors

IdentifierWhenMessage
RunMat:open:ArgumentCountThe call does not provide exactly one input argument.open: expected exactly one input argument
RunMat:open:InvalidNameThe name is not a string scalar or row character vector.open: name must be a character vector or string scalar
RunMat:open:NotFoundNo matching variable or file can be resolved.open: file or variable was not found
RunMat:open:UnsupportedFileTypeThe resolved file type cannot be opened by RunMat and no extension handler exists.open: unsupported file type
RunMat:open:HandlerFailedA custom open<extension> handler fails.open: extension handler failed
RunMat:open:TooManyOutputsThe call requests more than one output.open: expected at most one output

How open works

  • open name and A = open(name) accept a string scalar or row character vector.
  • Workspace variable names are accepted as editor-style opens and return an empty 0-by-0 array.
  • Names without an extension are searched on the current RunMat path using MATLAB-like file extensions.
  • Names with an explicit extension are first searched exactly on the current RunMat path so custom extensions such as .log can dispatch to openlog.
  • MAT-files are decoded through the same implementation as load and return a scalar struct with one field per variable.
  • .fig files first try RunMat figure-scene import and return a numeric figure handle when successful; otherwise RunMat decodes them as MAT-file containers until full MATLAB figure reconstruction is available.
  • For non-MAT files, RunMat looks for a semantic handler named open<extension> and passes the resolved file path as a string.
  • Known text, script, project/model, document, toolbox/install, executable, and spreadsheet file extensions open as no-op viewer/editor requests and return an empty 0-by-0 array.
  • Requesting more than one output raises RunMat:open:TooManyOutputs.
  • Unsupported file types without a handler raise RunMat:open:UnsupportedFileType.

Does RunMat run open on the GPU?

open is an I/O dispatcher and does not participate in GPU fusion or provider-native execution.

Examples

Load a MAT-file through open

S = open('results.mat')

Expected output:

% S is a struct containing the variables stored in results.mat.

Open a script from the current path

open setup

Expected output:

% setup.m is resolved and treated as an editor/viewer open.

Open a figure scene

h = open('plot.fig')

Expected output:

% h is a figure handle when plot.fig contains a RunMat figure scene payload.

Dispatch to a custom extension handler

function out = openabc(filename)
    out = fileread(filename);
end
out = open('payload.abc')

Expected output:

% openabc receives the resolved filename and returns its output.

Using open with coding agents

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

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

FAQ

Does open launch a desktop editor or external application?⌄

No. RunMat's runtime implementation is host-safe and noninteractive. It resolves the target and performs data-returning work where possible; viewer/editor opens complete as no-ops.

How is open('file.mat') different from load('file.mat')?⌄

For MAT-files, open returns the same struct-style data that load returns when called with one output.

Can user code customize how an extension opens?⌄

Yes. Define a function named open followed by the lowercase extension, for example openabc for .abc files. RunMat calls that handler with the resolved filename.

Related Io functions

Repl Fs

addpath · cd · copyfile · delete · dir · exist · fileattrib · fileparts · fullfile · genpath · getenv · getpref · isenv · isfile · isfolder · ispref · ls · matlabroot · memmapfile · mkdir · movefile · opentoline · path · pathsep · pcode · pwd · readstruct · rehash · restoredefaultpath · rmdir · rmpath · run · savepath · setenv · setpref · system · tempdir · tempname · uigetdir · uigetfile · uiputfile · unsetenv · userpath · what · winqueryreg · xmlread · xmlwrite

Net

accept · read · readline · tcpclient · tcpserver · write

Tabular

arrayDatastore · csvread · csvwrite · detectImportOptions · dlmread · dlmwrite · fileDatastore · parquetDatastore · parquetinfo · parquetread · readcell · readmatrix · readtable · readtimetable · spreadsheetImportOptions · writecell · writematrix · writetable · writetimetable · xlsread · xlswrite

Audio

audioinfo · audioread

Io

clc · diary · disp · display · format · input

Filetext

fclose · feof · fgetl · fgets · fileread · filewrite · fopen · fprintf · fread · frewind · fwrite · readlines · writelines

Archive

gunzip · gzip · unzip

Hdf5

h5disp · h5info · h5read · h5write · h5writeatt · hdf5info · hdf5read · hdf5write

Import

importdata · textscan

Json

jsondecode · jsonencode

Mat

load · matfile · save

Http

sendmail · urldecode · urlencode · weboptions · webread · websave · webwrite

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how open is executed, line by line, in Rust.

  • View the source for open in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 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
  • How open works
  • Does RunMat run open on the GPU?
  • Examples
  • Load a MAT-file through open
  • Open a script from the current path
  • Open a figure scene
  • Dispatch to a custom extension handler
  • Using open with coding agents
  • FAQ
  • Related Io functions
  • Repl Fs
  • Net
  • Tabular
  • Audio
  • Io
  • Filetext
  • Archive
  • Hdf5
  • Import
  • Json
  • Mat
  • Http
  • Open-source implementation
  • About RunMat