Excel Link | ![]() ![]() |
Example 5: Bond Cash Flow and Time Mapping
Example 5 illustrates the use of the MATLAB Financial Toolbox and Excel Link to compute a set of cash flow amounts and dates given a portfolio of five bonds whose maturity dates and coupon rates are known.
Click the Sheet6
tab on ExliSamp.xls
to try this example.
Make A18
the active cell. Press F2, then Enter to execute the Excel Link function that transfers the column vector Maturity
to MATLAB. Make A19
the active cell to transfer the column vector Coupon Rate
to MATLAB. Make A20
the active cell to transfer the settlement date to MATLAB. Execute the functions in cells A23
and A24
to use the Financial Toolbox to compute cash flow amounts and dates. Now execute the functions in cells A27
through A29
to transform the dates into string form contained in a cell array. Execute the functions in cells A32
through A34
to transfer the data to Excel.
Finally, execute the function in cell A37
to display a MATLAB plot of the cash flows for each portfolio item.
![]() | Example 4: Calculating and Plotting the Efficient Frontier of Financial Portfolios | Function Reference | ![]() |