怎样查看matlab中SVD的源码

来源:百度知道 编辑:UC知道 时间:2024/05/23 15:06:13

自带的有加密看不了,看看mathworks公司网站上会员分享的:

==========================================================

function [u,s,v] = svdsim(a,tol)
%SVDSIM simple SVD program
%
% A simple program that demonstrates how to use the
% QR decomposition to perform the SVD of a matrix.
% A may be rectangular and complex.
%
% usage: [U,S,V]= SVDSIM(A)
% or S = SVDSIM(A)
%
% with A = U*S*V' , S>=0 , U'*U = Iu , and V'*V = Iv
%
% The idea is to use the QR decomposition on A to gradually "pull" U out from
% the left and then use QR on A transposed to "pull" V out from the right.
% This process makes A lower triangular and then upper triangular alternately.
% Eventually, A becomes both upper and lower triangular at the same time,
% (i.e. Diagonal) with the singular values on the diagonal.
%
% Matlab's own SVD routine should always be the first choice to use,