Singular Value Decomposition calculation of a matrix

2 Ansichten (letzte 30 Tage)
HN
HN am 13 Sep. 2022
Kommentiert: HN am 15 Sep. 2022
I'm calculating the singular value decomposition of the following matrix A using the Matlab built-in function "svd":
A= [ 0 5 6; 8 9 4; 4 7 5];
"The result":
SVD_A = [16.8939733865235; 5.156904421786; 7.99007523366589e-16]
I tried chnaging the order of the rows in matrix A (by exchanging the 1st and 2nd column) to the following order and applied "svd" on B:
B= [ 8 9 4; 0 5 6; 4 7 5];
"The result":
SVD_B = [16.8939733865235; 5.156904421786; 9.8298029666369e-17]
I'm confused why is the last singular value in SVD vectors different although the two matrices are the same (only the order of the rows is different). How can I fix this issue?
Any help is appreciated!

Akzeptierte Antwort

James Tursa
James Tursa am 13 Sep. 2022
Bearbeitet: James Tursa am 13 Sep. 2022
By changing the order of the rows you have changed the order of operations inside svd( ). The two answers are essentially the same, you simply got slightly different values for the number that is essentially 0 in the context of the problem. In general, changing the order of floating point operations is not guaranteed to give the exact same numeric result. You might read this link:
There is nothing to "fix" in the answers ... you just need to adjust your thinking to the realities of floating point operations and have appropriate code to handle these types of outcomes.

Weitere Antworten (0)

Kategorien

Mehr zu Linear Algebra finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by