Using MATLAB & R to Solve Regression question