%% Find the Yield of a Security Paying Interest at Maturity Using datetime Inputs
% This example shows how to use datetime inputs find the yield of a security paying interest at maturity for the following:

Settle = '7-Feb-2000';
Maturity = '13-Apr-2000';
Issue = '11-Oct-1999';
Face = 100;
Price = 99.98;
CouponRate = 0.0608;
Basis = 1;

Settle = datetime(Settle,'Locale','en_US');
Maturity = datetime(Maturity,'Locale','en_US');
Issue = datetime(Issue,'Locale','en_US');

Yield = yldmat(Settle, Maturity, Issue, Face, Price,...
CouponRate, Basis)

% Copyright 2012 The MathWorks, Inc.