MATLAB Answers

svd function - Singular Value Decomposition

28 ビュー (過去 30 日間)
Mar 2018 年 5 月 1 日
コメント済み: Mar 2018 年 5 月 2 日
I want to solve the following system of equations using SVD:
S = AX,
where S is a 40x1 matrix (rows x columns), A is 40x3 and X is 3x1 matrix contains the unknowns.
I found the svd Matlab function which I want to use but I am not sure how to obtain the values of X after performing the SVD.
I found the SVD of the matrix A as follows:
[U,S,V] = svd(A);
U is a 40x40 matrix. S is a 40x3 matrix. V is a 3x3 matrix.
I have to use U, S and V to derive the solutions of X but I don't understand how.
Can anyone help with that?
Another question.
I have read that for an mxn matrix A there exists: an mxn orthogonal matrix U, an nxn diagonal matrix S an nxn orthogonal matrix V
such that A=U*S*transpose(V).
After using the svd in Matlab the outputs U,S,V have different dimensions from what I've read in the literature. I don't understand why though. Thank you.

回答 (1 件)

John D'Errico
John D'Errico 2018 年 5 月 1 日
編集済み: John D'Errico 2018 年 5 月 1 日
It is a really bad idea to use S in two totally different contexts. So I called the right hand side R. You will only become confused otherwise.
The solution that uses an SVD for the problem
R = A*X
is just:
X = pinv(A)*R
It uses the singular value decomposition to solve the problem. WTP? Oh, is this homework? Surely you were the one who needs to do your homework though, not us.
You should understand that
A*X = (U*S*V')*X
So your problem is to solve for X
(U*S*V')*X = R
What is U'*U? Think about it. What do you know about U? What would happen if you left-multiplied both sides by U'? Does that get you closer to a solution? What would the problem look like now? Can you take two more steps to realize a solution?
Finally, you seem surprised that U,S,V are not the same sizes that you expected. Did you read the help for SVD? SVD can return either the full SVD, or an economy size version, that requires much less memory to store. READ THE HELP. Consider the difference between svd(A), and svd(A,0).
  1 件のコメント
Mar 2018 年 5 月 2 日
OK I think I see your point. U'*U=I. So (U'*U*S*V')*X=U'*R then we get S*V'*X=U'*R solving this for X we get X=V*S^-1*U'*R. Is that correct? If so when I tried the svd(A) which is not the economy size version I have a problem with the dimensionality of the matrices when I tried to calculate X. Initially the dimensions for S is 40x3, when I calculate the inverse of S I got a 3x3 matrix. I did the following diag(diag(S).^-1. The matrix U is 40x40 matrix and the dimensions do not agree for the multiplication. Did I make a mistake in the calculation of the "inverse" of S? I know that the inverse do not exists for a non-square matrix.



Community Treasure Hunt

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

Start Hunting!

Translated by