%% Determine if Vector Is Regular
% Create a duration vector by using the seconds function.

D = seconds(1:5)

%
% Test D using the isregular function. D is regular because the time interval between consecutive elements is always the same.

tf = isregular(D)

%
% Change the last element of D.

D(end) = seconds(10)

%
% D is no longer regular.

tf = isregular(D)

% Copyright 2021 The MathWorks, Inc.