strtruncpad#

Purpose#

Truncates all elements of a string array to the specified number of characters, adding spaces on the end as needed to achieve the exact length.

Format#

y = strtruncpad(sa, maxlen)#
Parameters:
  • sa (NxK string array) – data

  • maxlen (1xK or 1x1 matrix) – maximum length.

Returns:

y (NxK string array) – contains contents of sa with all elements of truncated to the number of characters in maxlen.