Matlab codes
The page shows Matlab codes which I used in occasional in-class demonstrations, and some codes which I have written to help me with the homework. They are listed below in chronological order.
- cubiccurvature.m, a curvature illustration in Section 3.3 -> output image
- contourfocus.m, minimum illustration in Section 4.7 -> output image
- exercise344.m, color figure for #344 in Section 4.7 -> output image
- exercise1.m, midpoint rule for double integral on #1 in Section 5.1
- exercise67.m, midpoint rule for double integral on #67 in Section 5.2
- exercise100.m, midpoint rule for double integral on #100 in Section 5.2
- bumpysphere.m, plot a bumpy sphere (Section 2.7) -> output image
- twofields.m, plot vector fields using Matlab’s quiver (Section 6.1) -> output image
- surfaces.m, plot parameterized surfaces for #274, #277, #281 in Section 6.6 -> output image
Getting started with Matlab
You can use either Matlab online or Octave online. Also you can run Matlab on your own machine. If you are new to Matlab, try reading either Matlab’s “Getting Started” tutorial, or perhaps these short PDFs from David Maxwell’s courses:
- MATLAB Basics, which includes an intro to 2D plotting
- MATLAB 3d Graphics, including usage of
meshgrid
,surf
, andcontour