1 2 3 4 5 6
function [m, n] = regress(x, y) mn = [ x ones(length(x), 1) ] \ y; m = mn(1); n = mn(2); endfunction