reglin Linear regression Calling Sequence [a,b,sig]=reglin(x,y) Arguments x, y, a, b, sig numerical vectors or matrices. Description Solve the regression problem y=a*x+b in the least square sense. sig is the standard deviation of the residual. x and y are two matrices of size x(p,n) and y(q,n), where n is the number of samples. The estimator a is a matrix of size (q,p) and b is a vector of size (q,1). If x or y contains NaNs, use nanreglin. Examples Graphical example: x = -30:30; y = x.^3; [a, b] = reglin(x, y); plot(x, y, "red") plot(x, a*x+b) See Also nanreglin pinv leastsq qr