duration

Methods

Method Reference: duration.char

duration: cmat = char (D)

Convert duration array to a character matrix.

cmat = char (D) returns a character matrix with one row per element in D, taken in column-major order.

Rows shorter than the widest are padded on the left, so the character matrix is right-justified, as MATLAB returns it and as the array itself is displayed.

Source Code: duration

char converts the array into a character matrix of its display strings, one row per element.

 d = hours ([1.5; 2.25])
d =
  2x1 duration array

    1.5 hr     
    2.25 hr
 char (d)
ans =

 1.5 hr
2.25 hr