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:
Start Excel®, Spreadsheet Link EX, and MATLAB® sessions.
Navigate to the folder matlabroot\toolbox\exlink\.
Open the file ExliSamp.xls
Execute the example as needed.
Click the Sheet6 tab on ExliSamp.xls. The worksheet for this example appears.
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.
Make A19 the active cell to transfer the column vector Coupon Rate to the MATLAB workspace.
Make A20 the active cell to transfer the settlement date to the MATLAB workspace.
Execute the functions in cells A23 and A24 to enable the Financial Toolbox software 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 the Excel worksheet.
Finally, execute the function in cell A37 to display a plot of the cash flows for each portfolio item.
When you finish the example, close the figure window.