%% Find the Accrued Interest on a Certificate of Deposit Using datetime Inputs
% This example shows how to use datetime inputs to compute the accrued interest due, given a certificate of deposit with the following characteristics.

CouponRate =  0.05;
Settle =  datetime('02-Jan-02','Locale','en_US');
Maturity =  datetime('31-Mar-02','Locale','en_US');
IssueDate =  datetime('1-Oct-01','Locale','en_US');
AccrInt = cdai(CouponRate, Settle, Maturity, IssueDate)

% Copyright 2012 The MathWorks, Inc.