| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Spreadsheet Link EX |
| Contents | Index |
| Learn more about Spreadsheet Link EX |
MATLAB and Financial Toolbox functions compute and plot risks, variances, rates of return, and the efficient frontier of portfolios. Efficient portfolios have the lowest aggregate variance, or risk, for a given return.Microsoft Excel and the Spreadsheet Link EX software let you set up data, execute financial functions and MATLAB graphics, and display numeric results.
This example analyzes three portfolios, using rates of return for six time periods. In actual practice, these functions can analyze many portfolios over many time periods, limited only by the amount of computer memory available.
Click the Sheet5 tab on ExliSamp.xls. The worksheet for this example appears.

Make A15 the active cell. Press F2; then press Enter. The Spreadsheet Link EX function transfers the labels that describe the output that the MATLAB software computes.
Make A16 the active cell to copy the portfolio return data to the MATLAB workspace.
Execute the functions in A19 and A20 to compute the Financial Toolbox efficient frontier function for 20 points along the frontier.
Execute the Spreadsheet Link EX functions in A23, A24, and A25 to copy the output data to the Excel worksheet.
The worksheet looks as follows.

The data describes the efficient frontier for these three portfolios: that set of points representing the highest rate of return (ROR) for a given risk. For each of the 20 points along the frontier, the weighted investment in each portfolio (Weights) would achieve that rate of return.
Now move to A28 and press F2; then press Enter to execute the Financial Toolbox function that plots the efficient frontier for the same portfolio data.
The following figure appears.

The light blue line shows the efficient frontier. Note the change in slope above a 6.8% return because the Corporate Bond portfolio no longer contributes to the efficient frontier.
To try running this example using different data, close the figure window and change the data in cells B4:D9. Then reexecute all the Spreadsheet Link EX functions. The worksheet then shows the new frontier data, and the MATLAB software displays a new efficient frontier graph.
When you finish this example, close the figure window.
![]() | Pricing Stock Options Using the Binomial Model | Mapping Time and Bond Cash Flows | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |