%% Compute the True Break-Even Discount Using datetime Inputs
% This example shows how to use datetime inputs to compute the true break-even discount of a Treasury bill repurchase agreement.

RepoRate = [0.045; 0.0475];
InitialDiscount = 0.0475;
PurchaseDate = datetime('3-Jan-2002','Locale','en_US');
SaleDate = datetime('3-Feb-2002','Locale','en_US');
Maturity = datetime('3-Apr-2002','Locale','en_US');
TBEDiscount = tbillrepo(RepoRate, InitialDiscount,...
PurchaseDate, SaleDate, Maturity)

% Copyright 2012 The MathWorks, Inc.