%% Compute Treasury Bond Futures Price Given the Implied Repo Rates
% This example shows how to compute the quoted futures price and accrued interest due on the target delivery date, given the following data.

RepoData     = [0.020  2];
ReinvestData = [0.018  3];
Price        = [114.416; 113.171];
Settle       = datenum('11/15/2002'); 
MatFut       = [datenum('15-Dec-2002'); datenum('15-Mar-2003')];
ConvFactor   = [1 ; 0.9854];
CouponRate   = [0.06;0.0575];
Maturity     = [datenum('15-Aug-2009'); datenum('15-Aug-2010')];
 
[QtdFutPrice AccrInt] = tfutpricebyrepo(RepoData, ... 
ReinvestData, Price, Settle, MatFut, ConvFactor, CouponRate, ... 
Maturity)

% Copyright 2015 The MathWorks, Inc.