FUNCTION REFERENCE

split

Split text into strings, or cellstr for char/cellstr input.

Split text into strings, or cellstr for char/cellstr input.

Syntax

s = split(s,delimiter)

Syntax

[y,m,d] = split(cd,{'years','months','days'})

For calendarDuration input, split returns numeric years, months and days, and optionally a duration for the time unit; units must be unique and in calendar order.

Example

[y,m,d] = split(calendarDuration(1,2,3),{'years','months','days'})

A scalar becomes a column. Column vectors add a second axis with equal piece counts. Row vectors and matrices requiring a third axis are unsupported. Repeated delimiters collapse by default; pass 'CollapseDelimiters',false to retain empty pieces.

Example

split("a,b",",")

Differences from MATLAB: bounded 2-D string storage (65536 elements, 2 MiB text); MAT persistence and N-D strings are not implemented.

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