Skip to content

strings

Array of empty strings.

B = strings
B = strings(n)
B = strings(m, n)
B = strings(d1, d2, ...)

Creates an array of empty ("") strings with the given dimensions. With no arguments returns an empty string array; with one integer, an n×n square; with multiple, an N-dimensional array. Useful as a preallocated buffer when string values will be assigned in a loop.

strings(3) % 3×3 empty strings
strings(1, 5) % row of five empty strings
  • zeros — Array of all zeros.
  • ones — Array of all ones.