%% Compute the Cash Flow Structure and Time Factors for a Bond Portfolio and Return a datetime array for CFlowDates
% This example shows how to compute the cash flow structure and time factors for a bond portfolio that contains a corporate bond paying interest quarterly and a Treasury bond paying interest semiannually and CFlowDates is returned as a datetime array.

Settle = datetime('01-Nov-1993','Locale','en_US');
Maturity = ['15-Dec-1994';'15-Jun-1995'];
CouponRate= [0.06; 0.05];
Period = [4; 2];
Basis = [1; 0];
[CFlowAmounts, CFlowDates, TFactors, CFlowFlags] = cfamounts(CouponRate,...
Settle, Maturity, Period, Basis)

% Copyright 2012 The MathWorks, Inc.