%% Compute yearfrac When Specifying datetime Arrays
% Given a Basis of 9, compute yearfrac when the StartDate and EndDate are specified using datetime arrays.

yearfrac(datetime('1-Jan-2000','Locale','en_US'), '1/1/2001', 9)

% Copyright 2012 The MathWorks, Inc.