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
    • append
    • deblank
    • erase
    • eraseBetween
    • erasePunctuation
    • eraseURLs
    • extractAfter
    • extractBefore
    • extractBetween
    • insertAfter
    • insertBefore
    • join
    • lower
    • pad
    • replace
    • replaceBetween
    • reverse
    • split
    • splitlines
    • strcat
    • strip
    • strjoin
    • strjust
    • strrep
    • strsplit
    • strtrim
    • upper

strcat — Concatenate text inputs element-wise with MATLAB-compatible implicit expansion and trailing-space handling.

strcat concatenates text inputs element-wise across compatible array sizes. It supports MATLAB-compatible string, char, and cellstr container forms with implicit expansion semantics.

Syntax

out = strcat(str1, str2, ...)

Inputs

str1
Type
Any
Required
Yes
Description
First text input (string/char/cell).
str2
Type
Any
Required
Variadic
Description
Additional text inputs to concatenate element-wise.
NameTypeRequiredDefaultDescription
str1AnyYes—First text input (string/char/cell).
str2AnyVariadic—Additional text inputs to concatenate element-wise.

Returns

out
Type
Any
Description
Concatenated text preserving strcat output container semantics.
NameTypeDescription
outAnyConcatenated text preserving strcat output container semantics.

Errors

RunMat:strcat:TooManyOutputs
When
More than one output is requested.
Message
strcat: too many output arguments
RunMat:strcat:NotEnoughInputs
When
No arguments are supplied.
Message
strcat: not enough input arguments
RunMat:strcat:InvalidInput
When
An input is not a string, character array, or cell array of text scalars.
Message
strcat: inputs must be strings, character arrays, or cell arrays of character vectors
IdentifierWhenMessage
RunMat:strcat:TooManyOutputsMore than one output is requested.strcat: too many output arguments
RunMat:strcat:NotEnoughInputsNo arguments are supplied.strcat: not enough input arguments
RunMat:strcat:InvalidInputAn input is not a string, character array, or cell array of text scalars.strcat: inputs must be strings, character arrays, or cell arrays of character vectors
RunMat:strcat:CellElementA cell array contains a non-text element or non-row char array element.strcat: cell array elements must be character vectors or string scalars
RunMat:strcat:SizeMismatchInput shapes are not broadcast-compatible.strcat: array sizes are not compatible for broadcasting
RunMat:strcat:InternalErrorInternal output container construction failed.strcat: internal error

Behavior

Inputs are concatenated element-wise. Scalars expand across arrays of matching dimensions using MATLAB's implicit expansion rules.

When at least one input is a string array (or string scalar), the result is a string array. Typed missing string values propagate, so any missing operand yields a missing result for that element. Literal <missing> text concatenates as ordinary text.

When no string arrays are present but any input is a cell array of character vectors, the result is a cell array whose elements are character vectors.

Otherwise, the result is a character array. Character and character-cell operands have trailing ASCII whitespace removed before concatenation; leading and internal spaces remain intact.

Cell array elements must be character vectors (or string scalars). Mixing cell arrays with unsupported content raises a MATLAB-compatible error.

Empty inputs broadcast naturally: an operand with a zero-length dimension yields an empty output after broadcasting.

Integer and other numeric arrays are not implicitly formatted as text; use string first when numeric-to-text conversion is intentional.

Placement and effects

Text concatenation executes on the CPU. Numeric and provider-resident values are unsupported text inputs and reject before provider access.

This pure host operation may throw and may suspend at admitted gathers. It performs no callbacks, workspace/environment mutation, filesystem operations, randomness, or Clock reads. There is no GPU kernel, fusion route, or distributed support. VM and native calls share the canonical portable Runtime binding; these declarations are not execution evidence.

No. strcat accepts host text and returns host text. Provider-resident numeric values are unsupported text operands and reject before access.

RunMat performs text concatenation on the CPU. Unsupported resident numeric operands reject before provider lookup rather than being gathered and implicitly formatted.

Current implementation frontier

Character arrays with non-singleton dimensions beyond two, including those inside cells and delimiter controls, reject before row extraction. String and cell array geometry follows the per-entry behavior described here.

Character trimming currently removes trailing ASCII whitespace, not only spaces. Any string operand selects a string result, including when mixed with character arrays; old display-only character transcripts were incorrect. General managed text allocation remains incomplete.

Examples

Concatenate string scalars element-wise

greeting = strcat("Run", "Mat")

Concatenate a string scalar with a string array

names = ["VM", "JIT", "Accelerate"];
tagged = strcat("runmat-", names)

Concatenate character arrays while trimming trailing spaces

A = char("GPU ", "Planner");
B = char("Accel", " Stage ");
result = strcat(A, B)

Concatenate cell arrays of character vectors

C = {'Run ', 'Plan '; 'Fuse ', 'Cache '};
suffix = {'Mat', 'Ops'; 'Kernels', 'Stats'};
combined = strcat(C, suffix)

Propagate missing strings during concatenation

values = [string(missing) "ready"];
out = strcat("job-", values)

Broadcast a scalar character vector across a character array

labels = char("core", "runtime", "planner");
prefixed = strcat("runmat-", labels)

Using strcat with coding agents

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

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

FAQ

Does strcat remove spaces between words?⌄

No. strcat only strips trailing space characters from character inputs before concatenating. Spaces in the middle of a string remain untouched. To insert separators explicitly, concatenate the desired delimiter or use join.

How are missing strings handled?⌄

Missing string scalars (string(missing)) propagate. If any operand is missing for a specific element, the resulting element is <missing>.

What happens when I mix strings and character arrays?⌄

The output is a string array. Character inputs are converted to strings (after trimming trailing spaces) and combined element-wise with the string operands.

Can I concatenate cell arrays with string arrays?⌄

Yes. Inputs are implicitly converted to strings when any operand is a string array, so the result is a string array. Cell array elements must still contain character vectors (or scalar strings).

What if I pass numeric or logical inputs?⌄

strcat only accepts strings, character arrays, character vectors, or cell arrays of character vectors. Passing unsupported types raises a MATLAB-compatible error.

How are empty inputs treated?⌄

Dimensions with length zero propagate through implicit expansion. For example, concatenating with an empty string array returns an empty array with the broadcasted shape.

Related Strings functions

Transform

append · deblank · erase · eraseBetween · erasePunctuation · eraseURLs · extractAfter · extractBefore · extractBetween · insertAfter · insertBefore · join · lower · pad · replace · replaceBetween · reverse · split · splitlines · strip · strjoin · strjust · strrep · strsplit · strtrim · upper

Text Analytics

addDependencyDetails · addEntityDetails · addLemmaDetails · addPartOfSpeechDetails · addSentenceDetails · addTypeDetails · bagOfNgrams · bagOfWords · cosineSimilarity · doc2sequence · encode · extractFileText · extractHTMLText · fastTextWordEmbedding · findElement · getAttribute · htmlTree · ind2word · isVocabularyWord · normalizeWords · readWordEmbedding · removeLongWords · removeShortWords · removeStopWords · removeWords · stopWords · tokenDetails · tokenizedDocument · trainWordEmbedding · vaderSentimentScores · vec2word · word2ind · word2vec · wordEncoding · writeWordEmbedding

Core

blanks · char · compose · convertCharsToStrings · convertContainedStringsToChars · convertStringsToChars · genvarname · int2str · isletter · isspace · isStringScalar · isstrprop · mat2str · native2unicode · newline · num2str · sprintf · sscanf · str2double · str2num · strcmp · strcmpi · string · string.empty · strings · strlength · strncmp · strncmpi · strtok · unicode2native

Search

contains · endsWith · matches · startsWith · strfind

Pattern

digitsPattern · lettersPattern · pattern · regexpPattern · textBoundary · wildcardPattern

Regex

regexp · regexpi · regexprep

Source you can read

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

  • View the source for strcat 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
  • Behavior
  • Placement and effects
  • Current implementation frontier
  • Examples
  • Concatenate string scalars element-wise
  • Concatenate a string scalar with a string array
  • Concatenate character arrays while trimming trailing spaces
  • Concatenate cell arrays of character vectors
  • Propagate missing strings during concatenation
  • Broadcast a scalar character vector across a character array
  • Using strcat with coding agents
  • FAQ
  • Related Strings functions
  • Transform
  • Text Analytics
  • Core
  • Search
  • Pattern
  • Regex
  • Source you can read
  • About RunMat