RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

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.

/
See all docs
Builtin Reference
    • addlistener
    • addParameter
    • addprop
    • assignin
    • builtin
    • cancel
    • class
    • clear
    • clearAllMemoizedCaches
    • clearCache
    • clearvars
    • dbclear
    • dbstack
    • dbstatus
    • dbtype
    • eval
    • evalc
    • evalin
    • feval
    • findprop
    • func2str
    • functions
    • get.p
    • getcallinfo
    • getmethod
    • inputname
    • inputParser
    • isa
    • ischar
    • isdeployed
    • iskeyword
    • ismethod
    • isobject
    • isstring
    • isUnderlyingType
    • isvalid
    • keyboard
    • loadobj
    • localfunctions
    • matlab.metadata.DynamicProperty.delete
    • memoize
    • metaclass
    • mfilename
    • mislocked
    • mlock
    • munlock
    • namelengthmax
    • narginchk
    • nargoutchk
    • new_object
    • notify
    • numArgumentsFromSubscript
    • onCleanup
    • parse
    • saveobj
    • set.p
    • stats
    • str2func
    • subsasgn
    • subsref
    • superclasses
    • underlyingType
    • verLessThan
    • version
    • which
    • who
    • whos

isstring — Test whether values are string arrays in MATLAB and RunMat.

tf = isstring(x) returns true when x is a string array (including string scalars) and false otherwise. Distinction from char and other types follows MATLAB semantics.

Syntax

tf = isstring(A)

Inputs

A
Type
Any
Required
Yes
Description
Value inspected from metadata without payload conversion.
NameTypeRequiredDefaultDescription
AAnyYes—Value inspected from metadata without payload conversion.

Returns

tf
Type
LogicalArray
Description
Scalar logical type-query result.
NameTypeDescription
tfLogicalArrayScalar logical type-query result.

Behavior

String scalars such as "RunMat" and string arrays like ["alpha", "beta"] both return logical(1).

Empty string arrays produced by strings(0) or string.empty(...) are still recognised as the string type, so they return logical(1).

Character arrays created with single quotes ('text'), cell arrays of character vectors, numeric tensors, logical masks, structs, tables, and other non-string containers return logical(0).

gpuArray inputs currently store numeric or logical tensors in RunMat, so isstring(gpuArray(...)) returns logical(0), matching MATLAB’s behaviour.

The result is always a host logical scalar, making it easy to use for argument validation, control-flow guards, or input parsing.

GPU and residency

isstring runs entirely from metadata. When you pass a gpuArray, RunMat inspects the handle and returns logical(0) because device buffers do not yet store string data. No kernels are launched, and no host↔device transfers occur, so the device allocation remains resident for subsequent operations.

You usually do NOT need to call gpuArray yourself in RunMat (unlike MATLAB).

In RunMat, the fusion planner keeps residency on GPU in branches of fused expressions. As such, calling isstring on a gpuArray result leaves the device allocation untouched while still answering the question using metadata only.

To preserve backwards compatibility with MathWorks MATLAB, and for when you want to explicitly bootstrap GPU residency, you can call gpuArray explicitly to move data to the GPU if you want to be explicit about the residency.

Since MathWorks MATLAB does not have a fusion planner, and they kept their parallel execution toolbox separate from the core language, as their toolbox is a separate commercial product, MathWorks MATLAB users need to call gpuArray to move data to the GPU manually whereas RunMat users can rely on the fusion planner to keep data on the GPU automatically.

Inspects metadata on the host; gpuArray inputs are classified without kernel launches.

Legacy examples and displayed results

Checking if a string scalar is recognised

tf = isstring("RunMat")

Expected display: tf = logical(1)

Detecting string arrays with multiple elements

values = ["alpha", "beta", "gamma"];

tf = isstring(values)

Expected display: tf = logical(1)

Distinguishing strings from character vectors

tf_string = isstring("hello");

tf_char = isstring('hello')

Expected display: tf_string = logical(1)

tf_char = logical(0)

Confirming that empty string arrays are still strings

emptyStrs = strings(0, 2);

tf = isstring(emptyStrs)

Expected display: tf = logical(1)

Recognising that numeric and logical arrays are not strings

numbers = [1 2 3];

mask = true(1, 3);

tf_numbers = isstring(numbers);

tf_mask = isstring(mask)

Expected display: tf_numbers = logical(0)

tf_mask = logical(0)

Validating cell arrays of character vectors

cells = {'a', 'b', 'c'};

tf = isstring(cells)

Expected display: tf = logical(0)

Inspecting gpuArray inputs without transfers

G = gpuArray(ones(2, 2));

tf = isstring(G)

Expected display: tf = logical(0)

Using isstring in argument validation

function greet(name)

if ~isstring(name)

error("Name must be provided as a string.");

end

disp("Hello " + name + "!");

end

greet("RunMat");

% greet(42); % throws "Name must be provided as a string."

Expected display: Hello RunMat!

Example

Inspect a type with an assertion

tf = isstring("RunMat")

Using isstring with coding agents

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

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

FAQ

Does isstring return true for empty string arrays?⌄

Yes. Empty string arrays are still of type string, so isstring(strings(0)) returns logical(1).

How is isstring different from ischar?⌄

isstring recognises MATLAB’s modern string type introduced in R2016b. ischar recognises legacy character arrays created with single quotes. Only isstring returns true for double-quoted values.

What about string arrays stored inside cell arrays?⌄

Cell arrays are containers, so isstring({'a', 'b'}) returns logical(0). Use iscellstr or all(isstring(cells)) to validate the contents instead.

Can gpuArray hold string data in RunMat?⌄

Not currently. gpuArray values hold numeric or logical tensors, so isstring always reports logical(0) for device-resident data.

Does isstring inspect array contents element by element?⌄

No. It only checks the value’s type metadata, so the cost is constant regardless of array size.

Related Introspection functions

addlistener · addParameter · addprop · assignin · builtin · cancel · class · clear · clearAllMemoizedCaches · clearCache · clearvars · dbclear · dbstack · dbstatus · dbtype · eval · evalc · evalin · feval · findprop · func2str · functions · get.p · getcallinfo · getmethod · inputname · inputParser · isa · ischar · isdeployed · iskeyword · ismethod · isobject · isUnderlyingType · isvalid · keyboard · loadobj · localfunctions · matlab.metadata.DynamicProperty.delete · memoize · metaclass · mfilename · mislocked · mlock · munlock · namelengthmax · narginchk · nargoutchk · new_object · notify · numArgumentsFromSubscript · onCleanup · parse · saveobj · set.p · stats · str2func · subsasgn · subsref · superclasses · underlyingType · verLessThan · version · which · who · whos

Source you can read

Every RunMat function's source is public. Read exactly how isstring is executed, line by line, in Rust.

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

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/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
  • Behavior
  • GPU and residency
  • Legacy examples and displayed results
  • Example
  • Inspect a type with an assertion
  • Using isstring with coding agents
  • FAQ
  • Related Introspection functions
  • Source you can read
  • About RunMat