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
    • statget
    • statset

statset — Create or update statistics options structures.

statset creates, updates, or merges statistics options structures used by fitting, clustering, resampling, and related routines. Numeric option fields follow the documented single/double surface and parallel flags use logical values in MATLAB-compatible mode. RunMat mode additionally accepts all eight native integer classes as option values, validates them in their field-specific role, and then normalizes scalar counts or tolerances to ordinary option metadata while retaining typed vector payloads such as DerivStep.

Syntax

options = statset()
options = statset(statfun)
options = statset(name, value, ...)
options = statset(oldopts, newopts)
options = statset(oldopts, name, value, ...)

Inputs

NameTypeRequiredDefaultDescription
statfunStringScalarYes—Statistics function name.
nameStringScalarYes—Option field name.
valueAnyVariadic—Option value and additional name-value pairs.
oldoptsAnyYes—Existing statistics options structure.
newoptsAnyYes—Replacement statistics options structure. Nonempty fields override oldopts.
nameStringScalarNo—Option field name or replacement options structure.

Returns

NameTypeDescription
optionsAnyStatistics options structure.

Errors

IdentifierWhenMessage
RunMat:statset:InvalidArgumentArgument grammar does not match supported statset forms.statset: invalid argument
RunMat:statset:InvalidOptionAn option name or value is malformed.statset: invalid option
RunMat:statset:InvalidStatfunThe statfun argument is not a supported statistics function name.statset: invalid statistics function

How statset works

  • statset() returns a struct with canonical statistics option fields initialized to empty values.
  • statset(statfun) returns common defaults for recognized statistics functions. RunMat includes defaults for widely used fitting, clustering, resampling, and parallel-capable routines.
  • statset(name,value,...) creates an options struct from name-value pairs. statset(oldopts,name,value,...) copies an existing options struct and applies overrides.
  • statset(oldopts,newopts) merges nonempty fields from newopts into oldopts, preserving old values where the replacement field is empty.
  • Option names are case-insensitive and support unique leading prefixes, matching MATLAB-style option lookup.
  • Recognized fields include Display, MaxFunEvals, MaxIter, TolBnd, TolFun, TolTypeFun, TolX, TolTypeX, GradObj, Jacobian, DerivStep, FunValCheck, Robust, RobustWgtFun, WgtFun, Tune, UseParallel, UseSubstreams, Streams, and OutputFcn.
  • Numeric tolerance fields must be finite positive scalars, iteration fields must be positive integers, and enum fields such as Display, TolTypeFun, and FunValCheck are validated.
  • Callback, stream, and robust-weight payload fields preserve function handles and metadata values so consuming builtins can interpret them.
  • Native integer option values are a named RunMat extension. MATLAB-compatible mode rejects them before recursive gather; invalid integer values in non-option roles still receive the ordinary argument error rather than being misclassified as an extension.
  • Integer iteration counts are decoded exactly before range checks, logical-style fields normalize zero/nonzero values to logical in RunMat mode, and integer DerivStep arrays retain authoritative typed storage.

Examples

Create custom statistics options

opts = statset('TolX', 1e-8, 'Display', 'off')

Expected output:

`opts` is a struct with canonical statistics option fields.

Start from function defaults and override a value

opts = statset('nbinfit');
opts = statset(opts, 'TolX', 1e-8)

Expected output:

`opts` keeps `nbinfit` defaults such as `MaxIter` and uses the new `TolX`.

Merge two options structures

base = statset('MaxIter', 20);
update = statset('TolFun', 1e-7);
opts = statset(base, update)

Expected output:

`opts` contains both `MaxIter` and `TolFun`.

Using statset with coding agents

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

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

Related Stats functions

Options

statget

Ml

bayesopt · classify · confusionmat · crossvalind · cvpartition · fitclinear · fitctree · fitlm · kmeans · knnsearch · lasso · lassoglm · linkage · lscov · mnrfit · optimizableVariable · pdist · pdist2 · perfcurve · predict · regress · ridge · squareform · test · training · tsne

Summary

binocdf · boxplot · cdf · cdfplot · chi2cdf · corr · corrcoef · corrcov · cov · cov2corr · dummyvar · ecdf · filloutliers · fitdist · geomean · grpstats · harmmean · icdf · isoutlier · kstest · kurtosis · lsline · mad · mode · nanmax · normalize · normcdf · norminv · normpdf · onehotdecode · onehotencode · pdf · prctile · quantile · refline · rmse · skewness · tabulate · tcdf · tiedrank · tinv · tpdf · ttest2 · wblinv

Random

binornd · bootstrp · datasample · dividerand · exprnd · gamrnd · lhsdesign · mvnrnd · normrnd · random · randsample · rng · trnd · unidrnd · unifrnd · wblrnd

Hist

histc · histcounts · histcounts2

Open-source implementation

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

  • View the source for statset 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 statset works
  • Examples
  • Create custom statistics options
  • Start from function defaults and override a value
  • Merge two options structures
  • Using statset with coding agents
  • Related Stats functions
  • Options
  • Ml
  • Summary
  • Random
  • Hist
  • Open-source implementation
  • About RunMat