Navigation

Operators and Keywords

Function List:

C++ API

: strvcat (x)
: strvcat (x, …)
: strvcat (s1, s2, …)
: strvcat (cell_array)

Create a character array from one or more numeric matrices, character matrices, or cell arrays.

Arguments are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Unlike char, empty strings are removed and will not appear in the output.

For numerical input, each element is converted to the corresponding ASCII character. A range error results if an input is outside the ASCII range (0-255).

For cell arrays, each element is concatenated separately. Cell arrays converted through strvcat can mostly be converted back with cellstr. For example:

strvcat ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"])
     ⇒ ["abc    "
         "98     "
         "99     "
         "d      "
         "str1   "
         "half   "]

See also: char, strcat, cstrcat.

Package: octave