MATLAB code for regression example (ii)