MATLAB Links


MIT has a MATLAB help page.

We'll be using two special MATLAB routines, DFIELD and PPLANE, written by John Polking. He has some information on his web page.

Matlab quirks

Prof. Miller has collected a "Book of Matlab Secrets" (in postscript, dvi, and pdf formats). A few other people have pointed out some Matlab quirks. Elizabeth Immen reports: "I was reading in the book about MATLAB. It gave an example on page 52 about how to simplify an expression. When I typed in

h = simple (g)

as instructed, I did not get the expected result. I got a less complex answer than before, but not the one the book said I should." She's right. The answer MATLAB produces is simpler, but not as simple as possible (which is the expression given in the book).

Harm Derksen, one of the recitation instructors, has given an example of where DFIELD messes up: Try

y'=(y-x)/(y+x)

(perhaps with x between -4 and 4, and y also between -4 and 4). The direction field looks like a tornado. The solutions are perfect logarithmic spirals. (If you follow a path inwards, you would always be heading 45 degrees to the right of the origin.) MATLAB is unable to find the solution curves; it instead does something bizarre. Prof. Miller's response: the right way to handle an equation like this one is as an autonomous system on the plane, and use pplane.


(1) cubic.m exists in the Athena Matlab path, so if a student somehow failed to put cubic.m in the directory from which he launched Matlab the wrong cubic will get called.

(2) eul (and presumably Polking's other routines) does not work properly with intervals of the form [0,-3] under Athena or under the department system, although it produced reasonable results under the windows Student Edition 5.0 at home. I don't understand this, but it doesn't really matter since asking the students to think about this backward step business was a mistake anyway.


Return to 18.03 Home Page.