function [a, mse] = regression(x,y) a=mean(y./x) yPrime=a.*x error=abs(yPrime-y) mse=mean(error) plot(x,y,'o') hold on plot(x,yPrime,'r')