Here are some sample m-files and other resources you can download.
Feel free to make changes, and use them for your own scripts

Resources for PSETS

Category Name (click to download) Description
pset 1 parab.m   polynomial.m sample solutions
pset 2 poly_plot.m   phaseportrait.m sample solutions
pset 3 simpleNewtonSolver.m   my_sqrt.m templates
pset 3 Test Case Test Case
pset 3 simpleNewtonSolver.m   my_sqrt.m sample solutions
pset 4 and 5 traj.m  f.m  M.m templates
pset4 and 5 TestCase  traj_anim.m  traj.mat testcase
pset 4 and 5 traj.m  f.m sample solutions
pset 6 traj1_pset6.m  traj2_pset6.m  f_onespring.m  f_3springs.m templates
pset 6 traj.mat Contains different trajectories asked in the pset. Load the file and compare with your results.
animation for traj1   animation for traj2
pset 6 traj1_pset6.m  traj2_pset6.m  f_onespring.m  f_3springs.m sample solutions
pset 7 my_ode.m  f1.m   f2.m   f3.m (simple mass-spring)  traj1.m  traj2.m  err_step.m templates
pset 7 my_ode.m  err_step.m sample solutions

Resources from Lectures

Category Name (click to download) Description
lectures 4 and 5 Scripts seen in class (ODEs) sample code
lecture 11 Script seen in class (matrix diagonalization for solving coupled linear ODEs).) sample code