Matlab information, TAM 203, Spring 2009

You had Matlab in CS 100. You only need to learn here a few special commands like ODE45. If you feel your matlab background is not adequate, please send email to and say when you took CS 100, who taught it, whether you took M or J, and what any advisor told you about your need to learn Matlab when you were choosing between 100M and 100J.

To learn Matlab quickly I would recommend spending 4-8 hours doing the tutorials at the start of Rudra Pratap's "Getting Started With Matlab". This book was originally written for Cornell students who did not have Matlab at all in CS 100. You can order it from the campus store or buy it from Amazon.

There are some Matlab samples on older TAM 203 www pages (e.g. TAM203 2002).

Here are some samples.

Here is Euler's method done 3 times, from primitive to more sophisticated. The third example shows the program ODE1 which gives a hint about what is under the hood in the Matlab function ode45: Euler1   EulerMethod    fancyODE

A minimal ODE solution and plot, not good enough to hand in. A ball falling in honey.

A model ODE solution and plot, good enough to hand in.

Ball falling in honey. Uses 'event detection' to terminate integration based on dependent variables.

Two-degree-of-freedom oscillator. Uses matrices to set up equations.

Two particle collision (using backslash to solve simultaneous equations)

Forced spring-mass oscillator

Baseball trajectory and annotated pdf of output (w/ quadratic drag and lots of interesting plots).

How to rotate a simple line drawing and make it move around (animation)
Here's a complicated drawing and rotation (face)

Animation of mass hanging from spring in 2D

Solution of a problem (what was 13.83 in 2007) in Matlab

Cart and pendulum (2 DOF)  and Simple pendulum as a DAE