Mercurial > matrix-functions
view mftoolbox/polar_svd.m @ 8:a587712dcf5f draft default tip
funm_atom.m: rename fun_atom to funm_atom
* funm_atom.m: rename fun_atom to funm_atom.
author | Antonio Pino Robles <data.script93@gmail.com> |
---|---|
date | Fri, 29 May 2015 09:48:36 +0200 |
parents | 8f23314345f4 |
children |
line wrap: on
line source
function [U,H] = polar_svd(A) %POLAR_SVD Canonical polar decomposition via singular value decomposition. % [U,H] = POLAR_SVD(A) computes a matrix U of the same dimension % (m-by-n) as A, and a Hermitian positive semi-definite matrix H, % such that A = U*H. % U is a partial isometry with range(U^*) = range(H). % If A has full rank then U has orthonormal columns if m >= n % and orthonormal rows if m <= n. % U and H are computed via an SVD of A. [P,S,Q] = svd(A,'econ'); U = P*Q'; r = sum( diag(S) > norm(A,1)*eps/2 ); U = P(:,1:r)*Q(:,1:r)'; if nargout == 2 H = Q*S*Q'; H = (H + H')/2; % Force Hermitian by taking nearest Hermitian matrix. end