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

isUnderlyingType — Test whether a value has a specified underlying MATLAB data type.

isUnderlyingType(X, typename) returns true when underlyingType(X) equals typename. The type name must be a string scalar or a character row vector.

Syntax

tf = isUnderlyingType(X, typename)

Inputs

NameTypeRequiredDefaultDescription
XAnyYes—Input array or object to inspect.
typenameStringScalarYes—Underlying data type name to test.

Returns

NameTypeDescription
tfLogicalArrayTrue when X has the requested underlying type.

Errors

IdentifierWhenMessage
RunMat:isUnderlyingType:TypeNameInvalidSecond argument is not a string scalar or row character vector.isUnderlyingType: TYPENAME must be a string scalar or character vector
RunMat:isUnderlyingType:ProviderPayloadMismatchA resident input carries contradictory physical class metadata.isUnderlyingType: resident input has contradictory physical class metadata

How isUnderlyingType works

  • The predicate compares against the same canonical type names returned by underlyingType, such as "double", "single", "logical", "char", "string", "cell", and object class names.
  • The typename input accepts a string scalar or a character row vector. Multi-element string arrays, multi-row character arrays, and non-text values throw a structured argument error.
  • gpuArray inputs are checked from handle metadata. Exact class-name metadata is preferred for uploaded integer and floating-point device arrays; provider precision is used as a fallback for handles that only expose F32/F64.
  • isUnderlyingType(X, typename) compares the requested type name exactly after trimming surrounding whitespace.

Does RunMat run isUnderlyingType on the GPU?

No provider hook is required. RunMat maps gpuArray class-name, logical, and precision metadata to the same names returned by underlyingType and compares that name exactly with the requested type.

GPU memory and residency

isUnderlyingType is metadata-only for gpuArray inputs. It returns a host logical scalar and preserves provider residency for the inspected buffer.

Examples

Check a single-precision array

A = single([1 2 3]);
tf = isUnderlyingType(A, "single")

Expected output:

tf = logical(1)

Reject a mismatched underlying type

tf = isUnderlyingType(true, "double")

Expected output:

tf = logical(0)

Check gpuArray element type without gathering

G = gpuArray(single([1 2 3]));
tf = isUnderlyingType(G, "single")

Expected output:

tf = logical(1)

Using isUnderlyingType with coding agents

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

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

FAQ

Is this the same as isa(X, typename)?⌄

No. isa tests the class or category of the value itself. isUnderlyingType tests the data type returned by underlyingType, which differs for gpuArray values.

What text forms are accepted for typename?⌄

Use a string scalar such as "double" or a character row vector such as 'double'. Non-scalar string arrays and multi-row character arrays are rejected.

Will this gather gpuArray data?⌄

No. The predicate reads class-name, logical, and precision metadata from the gpuArray handle and returns a host logical scalar.

Related Introspection functions

addprop · assignin · class · clear · clearAllMemoizedCaches · clearCache · clearvars · dbclear · dbstack · dbstatus · dbtype · evalc · feval · findprop · getcallinfo · inputParser · isa · ischar · isdeployed · iskeyword · ismethod · isobject · isstring · 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 isUnderlyingType is executed, line by line, in Rust.

  • View the source for isUnderlyingType 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 isUnderlyingType works
  • Does RunMat run isUnderlyingType on the GPU?
  • GPU memory and residency
  • Examples
  • Check a single-precision array
  • Reject a mismatched underlying type
  • Check gpuArray element type without gathering
  • Using isUnderlyingType with coding agents
  • FAQ
  • Related Introspection functions
  • Open-source implementation
  • About RunMat