School of Engineering Brown University, 2011. — 49 pages.
This tutorial is intended to provide a crash-course on using a small subset of the features of MATLAB. If you complete the whole of this tutorial, you will be able to use MATLAB to integrate equations of motion for dynamical systems, plot the results, and use MATLAB optimizers and solvers to make design decisions.
You can work step-by-step through this tutorial, or if you prefer, you can brush up on topics from the list below. The tutorial contains more information than you need to start solving dynamics problems using MATLAB. If you are working through the tutorial for the first time, you should complete sections 1-
15. You can do the other sections later, when they are needed.
What is MATLAB
How does MATLAB differ from Mathematica?
Why do we have to learn MATLAB?
Starting MATLAB
Basic MATLAB windows
Simple calculations using MATLAB
MATLAB help
Errors associated with floating point arithmetic (and an example of a basic loop)
Vectors in MATLAB
Matrices in MATLAB
Plotting and graphics in MATLAB
Working with M-files
MATLAB Functions
Organizing complex calculations as functions in an M-file
Solving ordinary differential equations (ODEs) using MATLAB
Solving a basic differential equation
How the ODE solver works
Solving a differential equation with adjustable parameters
Solving a vector valued differential equation
Solving a higher order differential equation
Controlling the accuracy of solutions to differential equations
Looking for special events in a solution
Other MATLAB differential equation solvers
Using MATLAB solvers and optimizers to make design decisions
Using fzero to solve equations
Simple unconstrained optimization problem
Optimizing with constraints
Reading and writing data to/from files
Movies and animation
On the frustrations of scientific programming