7 lines
204 B
Matlab
7 lines
204 B
Matlab
function slope = mleslope(x, y )
|
|
% Compute the maximum likelihood estimate of the slope
|
|
% of a line through the origin
|
|
% given the data pairs in the vectors x and y.
|
|
slope = sum(x.*y)/sum(x.*x);
|
|
end
|