フィルターのクリア

tikhonov(U​,s,V,b,lam​bda,x_0) Error

4 ビュー (過去 30 日間)
Daniel Vasilaky
Daniel Vasilaky 2013 年 7 月 5 日
コメント済み: ANA ROSHAN 2019 年 8 月 29 日
I cant get tikhonov(U,s,V,b,lambda,x_0) to run even for a simple example given in Christian Hansen Package. Here it is including the error:
EDU>> clear
EDU>> A= [
0.15 0.1
0.16 0.1
2.02 1.3
];
b =[
0.27
0.25
3.33];
x=[
1;1
];
b=A*x;
db=[.01; -.032; .01];
b1=b+db;
x2=pinv(A)*b1;
x_0=[0;0];
lambda=0.001;
[U,s,V]=svd(A);
[x_lambda,rho,eta]=tikhonov(U,s,V,b,lambda,x_0);
[x_lambda,rho,eta]=tikhonov(U,s,V,b1,lambda,x_0);
Index exceeds matrix dimensions.
Error in tikhonov (line 66)
if (nargin==6), omega = V\x_0; omega = omega(1:p); end
%******************************************************************
When I try it on
A=hilb(12)
x=[1;1;1;1;1;1;1;1;1;1;1;1
after computong
b=A*x
and
U,s,V
x_0=[0;0;0;0;0;0;0;0;0;0;0;0]
I get NaN for output.
Not sure what I'm doing wrong. Can someone give a simple example that runs?
Thank you
  2 件のコメント
ANA ROSHAN
ANA ROSHAN 2019 年 8 月 29 日
VERY GOOD
ANA ROSHAN
ANA ROSHAN 2019 年 8 月 29 日

サインインしてコメントする。

採用された回答

Daniel Vasilaky
Daniel Vasilaky 2013 年 7 月 11 日
OK, I know what I was doing wrong. Instead of the full SVD I should have used the compact SVD, namely csvd. In a compact svd the columns of U and the rows of V’ are computed only for non-zero singular values. The zeroes in the full svd were causing the errors. Apologies for my ignorance.

その他の回答 (1 件)

Yishi
Yishi 2015 年 1 月 21 日
That works, I did not know either, but thanks for posting this comment

カテゴリ

Help Center および File ExchangeMathematics and Optimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by