HW3 prob 1 MATLAB stuff