%% Find the Yield of a Discounted Security Using datetime Inputs
% This example shows how to use datetime inputs to find the yield of the following discounted security.

Settle = '10/14/2000';
Maturity = '03/17/2001';
Face = 100;
Price = 96.28;
Basis = 2;

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

Yield = ylddisc(Settle, Maturity, Face, Price, Basis)

% Copyright 2012 The MathWorks, Inc.