MATLAB code for regression example