Fit a line to data using regress
5 views (last 30 days)
Hey all, I am trying to use a new matlab function "regress" and would like some help on how to use it to fit a line.
below is my code that I have so far, but lost on how to use the "regress" function.
x = 0:0.1:10;
n = 0;
noise = n*rand(1,length(x));
y = 2*x+1+noise;