www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ConvertDurationArrayToStringArrayExample.m

    %% Convert Duration Array to String Array
%%
% Create a |duration| array.
D = hours(23:25) + minutes(8) + seconds(1.2345)
%%
% Convert |D| to a string array.
str = string(D)
%%
% |str| is a string array with one duration value per element. |str| is the
% same size as |D|.
%%
% Specify the format of the duration values in |str|.
str = string(D,'hh:mm')