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

    %% Convert Durations to Numeric Array of Hours
%%
% Create a |duration| array.

% Copyright 2015 The MathWorks, Inc.

X = hours(2:10:38) + minutes(30)
%%
% Convert each duration in |X| to a number of hours.
H = hours(X)
%%
% View the data type of |H|
whos H