Method Reference: calendarDuration.char

calendarDuration: cmat = char (calD)
calendarDuration: cmat = char (calD, FMT)

Convert calendarDuration array to a character matrix.

cmat = char (calD) returns a character matrix with one row per element in calD. The second optional argument, FMT, can be used to specify the format of the returned string representations of the calendarDuration input array calD.

Source Code: calendarDuration

Example: 1

char converts the array into a character matrix of its display strings, one row per element (shorter rows padded with spaces).

 d = calmonths ([1, 13])
d =
  1x2 calendarDuration array

    1mo    1y 1mo
 char (d)
ans =

1mo   
1y 1mo