The singular value decomposition of a matrix is only defined up to a sign, so the signs of U
and V
are arbitrary, and both answers are correct. Whichever signs MATLAB produces, it should still be the case that F = U*S*V
, so U
and V
constitute a correct singular value decomposition of F
. (Note "a", not "the").
You shouldn't rely on MATLAB producing particular signs, and it may vary from version to version.