The Midpoint Method

Let's consider the initial value problem
dy/dt = t*exp(3*t) - 2*y
y(0) = 0
0 <= t <= 1
A Matlab script to solve this problem that employs the midpoint method can be
downloaded here.
It uses the functions
deriv.m and
exact.m to make the program more readable.