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
    • arrayDatastore
    • csvread
    • csvwrite
    • detectImportOptions
    • dlmread
    • dlmwrite
    • fileDatastore
    • parquetDatastore
    • parquetinfo
    • parquetread
    • readcell
    • readmatrix
    • readtable
    • readtimetable
    • spreadsheetImportOptions
    • writecell
    • writematrix
    • writetable
    • writetimetable
    • xlsread
    • xlswrite

detectImportOptions — Inspect text or spreadsheet data and create import options for tabular readers.

opts = detectImportOptions(filename) samples a delimited text or spreadsheet file and returns an editable scalar struct accepted by readtable and, for numeric text imports, readmatrix.

Syntax

opts = detectImportOptions(filename)
opts = detectImportOptions(filename, nameValuePairs...)

Inputs

NameTypeRequiredDefaultDescription
filenameStringScalarYes—Text or spreadsheet file path to inspect.
nameValuePairsAnyVariadic—Detection overrides such as Delimiter, Range, Sheet, Encoding, or TextType.

Returns

NameTypeDescription
optsAnyDetected import options struct accepted by readtable/readmatrix.

Errors

IdentifierWhenMessage
RunMat:table:InvalidArgumentArguments or table metadata are invalid.table: invalid argument
RunMat:table:InvalidIndexTable indexing is invalid.table: invalid index
RunMat:table:InvalidVariableA table variable name or value is invalid.table: invalid variable
RunMat:readtable:IOErrorreadtable cannot open or read the requested file.readtable: file read failed
RunMat:readtable:UnsupportedFileTypereadtable receives a file type outside the text or spreadsheet import backends.readtable: unsupported file type

How detectImportOptions works

  • Detects text delimiters from comma, tab, semicolon, pipe, and whitespace-separated records unless Delimiter is supplied.
  • Infers variable names from a non-data header row and sets NumHeaderLines so readers import only data rows.
  • Infers VariableTypes as double, logical, datetime, or text (string/char) using the same token rules as readtable.
  • Honors the implemented text/spreadsheet override subset, including FileType, Delimiter, NumHeaderLines, Range, DataRange, Sheet, ExpectedNumVariables, VariableNamesLine, VariableNames, VariableTypes, ReadVariableNames, ReadRowNames, TreatAsMissing, VariableNamingRule, TextType, DatetimeType, EmptyLineRule, and Encoding.
  • Integer Range, DataRange, Sheet, ExpectedNumVariables, and VariableNamesLine controls are parsed exactly from all eight integer classes. ExpectedNumVariables and Sheet must be positive; boolean controls accept only logical values or exact numeric zero/one.
  • Numeric DataRange currently supports a positive scalar start row or one 1-by-2 increasing row interval. Textual cell references are supported for detected-option replay; multiple numeric Nx2 intervals remain a recorded general gap.
  • Typed-integer NumHeaderLines is a RunMat-only extension. Compatibility mode rejects it before provider or file access; scalar single and double remain public inputs.
  • For spreadsheet files, uses the same sheet/range reader as readtable and emits spreadsheet-compatible option fields.
  • The returned struct intentionally contains fields understood by current RunMat readers. Concrete MATLAB import-options classes and JSON, XML, Word, HTML, and archive option families remain recorded general gaps.

Does RunMat run detectImportOptions on the GPU?

No acceleration provider hooks are used. Resident arguments are rejected without a download.

GPU memory and residency

detectImportOptions performs file inspection on the host and returns host metadata. It does not create GPU-resident arrays.

Examples

Detect And Reuse CSV Import Options

opts = detectImportOptions("measurements.csv");
T = readtable("measurements.csv", opts);

Override Detection Settings

opts = detectImportOptions("log.txt", 'Delimiter', '|', 'NumHeaderLines', 2);
opts.VariableTypes(2) = "double";
T = readtable("log.txt", opts);

Use Options With Numeric Imports

opts = detectImportOptions("values.csv");
A = readmatrix("values.csv", opts);

Using detectImportOptions with coding agents

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

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

FAQ

Is the returned value a MATLAB import-options object?⌄

RunMat represents import options as a scalar struct so field assignment and reader consumption work naturally in the current runtime.

Can I use the same options with readmatrix?⌄

Yes for numeric text imports. readmatrix consumes fields such as Delimiter, NumHeaderLines, Range, and TreatAsMissing and ignores table-specific fields.

Does detection read the whole file?⌄

RunMat currently reads the file into host memory and samples the parsed rows, matching the existing readtable import pipeline.

Can detection options be GPU-resident?⌄

No. Resident path or option values, including nested values, are rejected before provider or file access.

Related Io functions

Tabular

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

Net

accept · read · readline · tcpclient · tcpserver · write

Repl Fs

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

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 detectImportOptions is executed, line by line, in Rust.

  • View the source for detectImportOptions 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 detectImportOptions works
  • Does RunMat run detectImportOptions on the GPU?
  • GPU memory and residency
  • Examples
  • Detect And Reuse CSV Import Options
  • Override Detection Settings
  • Use Options With Numeric Imports
  • Using detectImportOptions with coding agents
  • FAQ
  • Related Io functions
  • Tabular
  • Net
  • Repl Fs
  • Audio
  • Io
  • Filetext
  • Archive
  • Hdf5
  • Import
  • Json
  • Mat
  • Http
  • Open-source implementation
  • About RunMat