# MATLAB 60-60/Introduction

### for Summer URA Program, July/09.

• This interactive seminar will provide an introduction to the powerful computing environment of MATLAB and demonstrate the tools needed for conducting research in combinatorics and optimization using MATLAB.
• The first 60 minutes will focus on some of the basics of MATLAB, from entering matrices, solving linear systems, and calculating eigenvalues, to using the graphical features of MATLAB for plotting functions and even graphs.
• The second 60 minutes will look at writing your own MATLAB programs (M-files), using symbolic MATLAB, and solving both discrete and continuous optimization problems using the MOSEK optimization toolbox.

## Details

• The Origins of MATLAB, with a (enjoy) video.
• ## First 60:

1. bring up MATLAB help page (click on Help and choose MATLAB Help)
2. Click on Demos and then: +MATLAB -> +Mathematics -> Basic Matrix Operations
3. Matrices and Arrays:
• MATrix LABoratory
• vectors are nx1 matrices
• click on: Run in the Command Window; click on Next when ready
• Try to enter your own vector y=[....
Try to enter your own matrix Y=[....
• Try the help command: help poly or help conv or try doc conv
• Solve a system of linear equations: x=A\b - demo with roundoff error example.
4. Plots:
• Click on Demos and then: +MATLAB -> +Mathematics -> Optimal Fit of a Non-linear Function
• Try: help gplot; help ezplot; help spy
5. Symbolic Toolbox:
• Close off +MATLAB; +Toolboxes -> +Symbolic Math -> Symbolic Matrix Computation
6. Debugging:
• keyboard, dbstep, mlint, help debug
• ## Second 60:

1. MOSEK with MATLAB; Documentation
2. MOSEK: A Guided Tour; First check path to find out where MOSEK is or use: which mosekopt; then, use e.g. command
• lo1 (a simple LP using msklpopt)
• lo2 (LP using mosekopt and problem structure)
• qo1 (a simple QP using mskqpopt)
• qo2 (QP using mosekopt and problem structure)
• cqo1 (Conic Opt using mosekopt and problem structure)
• qco1 (quadrically constrained Opt using mosekopt and problem structure)
• milo1 (Mixed Integer Opt using mosekopt and problem structure;
3. Large scale QP:
Files: spqp.m , runspqp.m (use ssh -X nina.msri.org)
4. Remove the path to MOSEK and then run the optimtool in MATLAB. (See the quick reference guide on the right.)
5. Porfolio Analysis (demo)

Back to Main Course Page