Matlab code for performing a weighted linear regression in matlab and getting out all the important stuff