%% Differences Between Datetime Values
% Create a sequence of equally-spaced datetime values, and find the time differences between them.

t1 = datetime('now');
t2 = t1 + minutes(5);
t = t1:minutes(1.5):t2

%

dt = diff(t)

% diff returns a duration array.
% Copyright 2015 The MathWorks, Inc.