Prog2 Matlab code. Sigh.