On 01/12/2017 10:42 AM, Sebastian Schöps wrote:
Montgomery-Smith, Stephen wrote
My guess is that it is solving the underdetermined equation:
x1+x2+x3+x4=1.
So both solutions are correct answers. There are infinitely many correct
answers.
If I had to choose, I guess I would go for the answer who square sum is
minimized, which would favor Octave's answer.
Thanks! That explains the behaviour and I agree that both solutions do make
sense. However, is that documented somewhere? Shouldn't there be a warning?
Similar to the case when a singular linear equation system is solved?
For which cases do you want warnings?
Do you want a warning because the particular solution is different from
Matlab, or because the system is not square?
Does Matlab always warn when solving least-squares problems?