Documentation

Map Time and Bond Cash Flows

This example shows how to use the Financial Toolbox™ and Spreadsheet Link™ EX software to compute a set of cash flow amounts and dates, given a portfolio of five bonds with known maturity dates and coupon rates. It is included in the Spreadsheet Link EX product. To run it:

  1. Start Excel®, Spreadsheet Link EX, and MATLAB® sessions.

  2. Navigate to the folder matlabroot\toolbox\exlink\.

  3. Open the file ExliSamp.xls

  4. Execute the example as needed.

    Note   This example requires Financial Toolbox, Statistics Toolbox™, and Optimization Toolbox™.

  1. Click the Sheet6 tab on ExliSamp.xls. The worksheet for this example appears.

  2. Make A18 the active cell. Press F2, then Enter to execute the Spreadsheet Link EX function that transfers the column vector Maturity to the MATLAB workspace.

  3. Make A19 the active cell to transfer the column vector Coupon Rate to the MATLAB workspace.

  4. Make A20 the active cell to transfer the settlement date to the MATLAB workspace.

  5. Execute the functions in cells A23 and A24 to enable the Financial Toolbox software to compute cash flow amounts and dates.

  6. Now execute the functions in cells A27 through A29 to transform the dates into string form contained in a cell array.

  7. Execute the functions in cells A32 through A34 to transfer the data to the Excel worksheet.

  8. Finally, execute the function in cell A37 to display a plot of the cash flows for each portfolio item.

  9. When you finish the example, close the figure window.

Was this topic helpful?