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
    • addprop
    • assignin
    • class
    • clear
    • clearAllMemoizedCaches
    • clearCache
    • clearvars
    • dbclear
    • dbstack
    • dbstatus
    • dbtype
    • evalc
    • feval
    • findprop
    • getcallinfo
    • inputParser
    • isa
    • ischar
    • isdeployed
    • iskeyword
    • ismethod
    • isobject
    • isstring
    • isUnderlyingType
    • keyboard
    • matlab.metadata.DynamicProperty.delete
    • memoize
    • metaclass
    • mislocked
    • mlock
    • munlock
    • namelengthmax
    • narginchk
    • nargoutchk
    • notify
    • onCleanup
    • stats
    • str2func
    • superclasses
    • underlyingType
    • verLessThan
    • version
    • which
    • who
    • whos

dbstack — Return or display the active RunMat call stack.

dbstack inspects RunMat's runtime call-stack context and returns MATLAB-style frame metadata.

Syntax

dbstack
ST = dbstack
ST = dbstack(n)
ST = dbstack('-completenames')
ST = dbstack('-completenames', n)
ST = dbstack(n, '-completenames')
All supported dbstack forms
dbstack
ST = dbstack
ST = dbstack(n)
ST = dbstack('-completenames')
ST = dbstack('-completenames', n)
ST = dbstack(n, '-completenames')
[ST,I] = dbstack
[ST,I] = dbstack(n)
[ST,I] = dbstack('-completenames')
[ST,I] = dbstack('-completenames', n)
[ST,I] = dbstack(n, '-completenames')

Inputs

NameTypeRequiredDefaultDescription
nIntegerScalarYes—Number of leading stack entries to omit.
optionStringScalarYes—`-completenames` requests full source paths.

Returns

NameTypeDescription
STAnyCall-stack entries in RunMat's column-cell representation of a structure array.
INumericScalarCurrent workspace index within the returned stack.

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

Errors

IdentifierWhenMessage
RunMat:TooManyInputsA debugger compatibility helper receives more inputs than it supports.debugger helper: too many input arguments
RunMat:dbstack:TooManyOutputsMore than two outputs are requested from dbstack.dbstack: too many output arguments
RunMat:InvalidInputAn input is not a supported text, scalar, or option value.debugger helper: invalid input
RunMat:NoCurrentFile`mlock`, `munlock`, or `mislocked` is called without a current function or script.debugger helper: no current function or script is available
RunMat:FileNotFound`dbtype` cannot resolve a MATLAB source file.dbtype: file not found
RunMat:FileReadFailed`dbtype` cannot read the resolved source file.dbtype: failed to read file

How dbstack works

  • dbstack with no output displays the active stack.
  • ST = dbstack returns stack entries as an N-by-1 cell column of scalar structs because RunMat does not yet have first-class MATLAB struct arrays.
  • Each frame struct contains exactly the public file, name, and line fields; I is a separate second output.
  • dbstack(n) omits the first n returned entries; both dbstack('-completenames', n) and dbstack(n, '-completenames') additionally report full source paths when the source catalog has them.
  • [ST,I] = dbstack(...) returns the stack cell column and a current workspace index of 1 when a stack is available; more than two requested outputs reject.

Does RunMat run dbstack on the GPU?

dbstack is host-side introspection and is excluded from GPU execution and fusion.

Examples

Capture the current call stack

ST = dbstack;

Skip the current frame

ST = dbstack('-completenames', 1);

Using dbstack with coding agents

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

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

FAQ

Why is ST a cell column instead of a struct array?⌄

RunMat currently represents heterogeneous struct-list results as an N-by-1 cell column of scalar structs. This preserves the public frame fields and shape orientation until struct-array infrastructure lands.

Related Introspection functions

addprop · assignin · class · clear · clearAllMemoizedCaches · clearCache · clearvars · dbclear · dbstatus · dbtype · evalc · feval · findprop · getcallinfo · inputParser · isa · ischar · isdeployed · iskeyword · ismethod · isobject · isstring · isUnderlyingType · keyboard · matlab.metadata.DynamicProperty.delete · memoize · metaclass · mislocked · mlock · munlock · namelengthmax · narginchk · nargoutchk · notify · onCleanup · stats · str2func · superclasses · underlyingType · verLessThan · version · which · who · whos

Open-source implementation

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

  • View the source for dbstack 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 dbstack works
  • Does RunMat run dbstack on the GPU?
  • Examples
  • Capture the current call stack
  • Skip the current frame
  • Using dbstack with coding agents
  • FAQ
  • Related Introspection functions
  • Open-source implementation
  • About RunMat