May I ask about the difference of solving for x
in these 2 following ways in Matlab :
Way 1: x = A\b
Way 2: x = inv((A.').*A)*(A.'*b)
(p.s: the inverted matrix is invertible)
I think these two ways should give the same results but I can not achieve this matching. I want to apply the Least square fashion. However it includes many different types of matrix (transpose, invert and then multiple) and when writing on Matlab language, I've got confusion. Please would you help me point out the wrong things in way 2.
Thank you very much for your comments !