I have to solve un overdetermined system with least squares method. I wrote in matlab 'A\b' and it gives me only one solution correct. Why? Or how can I solve the problem efficently?

5 views (last 30 days)
up-Xup*up-Xuu*u^2-Xvv*r^2-Xvr*v*r-v*r-Xrr*r^2 = 2*Xr+2*Xp
This is my equation. I have to find Xup, Xuu, Xvv, Xvr, Xrr. For solving this I have a folder .xlsx from where I import some values for coeff. of my unkowns.
In fact, this means I define my matrix (A and b).
To solve this I wrote A\b in matlab but the answer is not as I expected.
I must use least squares method.
Thaanks!
  3 Comments
Paul-Catalin Puscasu
Paul-Catalin Puscasu on 10 Dec 2018
If I solve mathematically for example M = At*A, N = At*B, where At = transpose(A) and than x = M\N it gives me a warning. : 'Matrix is singular to working precision.' And if I solve x = A\b it gives me a warning about rank.

Sign in to comment.

Answers (1)

John D'Errico
John D'Errico on 10 Dec 2018
Edited: John D'Errico on 10 Dec 2018
help pinv
help lsqminnorm
Either will apply.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!