Im trying to construct a function in matlab that models linear least squares model fitting through the use of normal equations.
A= [column vector of all x ; column vector of all 1]
y= [column vector of all y]
c = [b;a] where a&b are coefficients of the best fit line
The Attempt at a Solution
Error in ==> mregress at 2
I am very new to matlab and dont know much about it.
I think the problem is representing x a column vector and 1 is also a column vector of 1.
How do I represent this?