FUNCTION REFERENCE

strcat

Join text horizontally.

Join text horizontally.

Syntax

s = strcat(s1, s2, ...)

Syntax

c = strcat(c1, s2, ...)

For character arguments, trailing spaces of each argument are removed and the pieces are joined. If any argument is a cell array, the result is a cell array and cell elements keep their spaces. Cell arrays need the same size, or be 1-by-1.

Example

strcat('ab', 'cd', 'e')   % 'abcde'

String inputs concatenate element-wise with singleton expansion, preserving spaces and string shape.

Example

strcat(["a " "b"],"!")

Differences from MATLAB: string storage is two-dimensional and bounded.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.