This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Introduction to Matlab Alexander Philipov, [email protected] September 3, 2009 1 Objectives Learn: • The matlab interface: command window, workspace, help browser, • matlab data and variable types, operators, functions, • types of matlab files and loading data, • creating matlab programs and functions, • matlab graphs and visualization. 2 Examples: 1. Load text, commaseparated (csv), and matlab data files 2. Create descriptive statistics program 3. Create OLS regression program 4. Compute efficient frontier under unconstrained optimization 5. Compute efficient frontier under constrained optimization 6. Use the financial toolbox to compute the efficient frontier 7. Program the BlackScholes option pricing formula 8. Create program to compute implied volatility 9. Use the financial toolbox to compute the option price and implied volatility 10. Create program for simulating from N ( μ, σ 2 ) distribution 1 3 The Matlab Environment 3.1 What is Matlab? MATLAB is a highperformance language for technical computing. It integrates compu tation, visualization, and programming in an easytouse environment where problems and solutions are expressed in familiar mathematical notation. With Matlab, one can program with matrix and vector formulations in a fraction of the time it would take to write a program in a scalar noninteractive language such as C or Fortran. Toolboxes are comprehensive collections of MATLAB functions (Mfiles) that extend the MATLAB environment to solve particular classes of problems. 3.2 The MATLAB System The MATLAB system consists of five main parts: 1. Development Environment This is the set of tools and facilities that help you use MATLAB functions and files. Many of these tools are graphical user interfaces. It includes the MATLAB desktop and Command Window, a command history, an editor and debugger, and browsers for viewing help, the workspace, files, and the search path. 2. The MATLAB Mathematical Function Library. This is a vast collection of compu tational algorithms ranging from elementary functions like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier transforms. 3. The MATLAB Language. This is a highlevel matrix/array language with control flow statements, functions, data structures, input/output, and objectoriented pro gramming features. It allows both ”programming in the small” to rapidly create quick and dirty throwaway programs, and ”programming in the large” to create complete large and complex application programs. 4. Graphics. MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. It includes highlevel 2 functions for twodimensional and threedimensional data visualization, image pro cessing, animation, and presentation graphics. It also includes lowlevel functions that allow you to fully customize the appearance of graphics as well as to build...
View
Full Document
 Spring '12
 GerganaJostova
 matlab, Ring

Click to edit the document details