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
    • cell
    • cell2mat
    • cell2struct
    • cellfun
    • cellstr
    • mat2cell
    • num2cell

cellstr — Convert text arrays to a cell array of character vectors.

cellstr converts character rows or string elements into character vectors stored in a cell array.

Syntax

C = cellstr(A)

Inputs

A
Type
Any
Required
Yes
Description
Character array, string array, or supported RunMat text value.
NameTypeRequiredDefaultDescription
AAnyYes—Character array, string array, or supported RunMat text value.

Returns

C
Type
Any
Description
Cell array of character vectors.
NameTypeDescription
CAnyCell array of character vectors.

Errors

RunMat:cellstr:TooManyOutputs
When
More than one output is requested.
Message
cellstr: too many output arguments
RunMat:cellstr:InvalidInput
When
The input is not a supported text value.
Message
cellstr: input must be text-compatible
RunMat:cellstr:InvalidContents
When
A cell input contains something other than a character vector or string scalar.
Message
cellstr: cell array elements must be text scalars
—
When
The supplied array shape does not match its storage.
Message
cellstr: internal shape error
IdentifierWhenMessage
RunMat:cellstr:TooManyOutputsMore than one output is requested.cellstr: too many output arguments
RunMat:cellstr:InvalidInputThe input is not a supported text value.cellstr: input must be text-compatible
RunMat:cellstr:InvalidContentsA cell input contains something other than a character vector or string scalar.cellstr: cell array elements must be text scalars
—The supplied array shape does not match its storage.cellstr: internal shape error

Character and string arrays

cellstr(A) converts each string element to a character vector and preserves the string array's shape. A character array instead produces one output cell per row and removes trailing whitespace from each row, except for significant whitespace such as a nonbreaking space.

An empty string scalar produces one cell containing an empty character array. An empty string array preserves its array shape, while a character array with zero rows produces a 0-by-1 cell array.

RunMat text inputs

RunMat compatibility mode also accepts cell arrays containing character vectors and string scalars, and symbolic scalars or arrays. Cell-array conversion preserves the outer shape and moves existing character vectors into the new container without inspecting resident numeric providers.

Cell and symbolic inputs are explicit RunMat extensions. MATLAB compatibility mode rejects those forms. Numeric, logical, object, and resident tensor inputs are not converted to text.

Current coverage

Character and string arrays are supported in native and browser runtimes. Datetime, duration, calendar-duration, and categorical forms are not yet implemented; the catalog marks the contract incomplete until those documented forms have implementations.

Typed missing string elements are rejected because this conversion requires character contents. Literal <missing> text converts as ordinary text; no broader missing-value compatibility claim is made.

Examples

Convert character-array rows

A = ['abc '; 'defg'; 'hi  '];
C = cellstr(A);

Expected output:

C is a 3-by-1 cell array containing 'abc', 'defg', and 'hi'

Preserve a string array's shape

A = ["north", "south"; "east", "west"];
C = cellstr(A);

Expected output:

C is a 2-by-2 cell array of character vectors

Convert an empty string scalar

C = cellstr("");

Expected output:

C is a scalar cell containing an empty character array

Convert one string scalar

C = cellstr("RunMat");

Expected output:

C is a scalar cell containing 'RunMat'

Convert an empty character array

A = char(zeros(0, 5));
C = cellstr(A);

Expected output:

C is a 0-by-1 cell array

Normalize an existing text cell array

C = cellstr({'left', "right"});

Expected output:

C contains two character vectors

Reject numeric input

cellstr(42);

Expected output:

RunMat:cellstr:InvalidInput

Using cellstr with coding agents

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

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

FAQ

Which whitespace is removed from character-array rows?⌄

Trailing whitespace is removed except for significant whitespace such as a nonbreaking space. Interior characters are unchanged; character vectors already stored in cell inputs are not trimmed.

Does conversion gather GPU data?⌄

No. RunMat has no resident text representation. Resident numeric values reject before provider lookup, including values nested in a cell input.

Why are cell and symbolic inputs marked as extensions?⌄

They are useful RunMat conversions but are not part of the documented compatible input set. They require RunMat compatibility mode.

Related Cells functions

cell · cell2mat · cell2struct · cellfun · mat2cell · num2cell

Source you can read

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

  • View the source for cellstr 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
  • Errors
  • Character and string arrays
  • RunMat text inputs
  • Current coverage
  • Examples
  • Convert character-array rows
  • Preserve a string array's shape
  • Convert an empty string scalar
  • Convert one string scalar
  • Convert an empty character array
  • Normalize an existing text cell array
  • Reject numeric input
  • Using cellstr with coding agents
  • FAQ
  • Related Cells functions
  • Source you can read
  • About RunMat