How to work with a matrix close to singular in MATLAB ?

33 ビュー (過去 30 日間)
HN
HN 2020 年 10 月 27 日
編集済み: HN 2020 年 10 月 29 日
I've ill-conditioned matrix which shows its inverse close to singular. So, the minimization solution is unstable. The psedoinverse gives abruptly different outcome from the inverse. Is there any method to handle this kind of issue in matlab?
Thanks

採用された回答

John D'Errico
John D'Errico 2020 年 10 月 27 日
Sorry, but no magic exists. This is why numerical linear algebra exists as an area of mathematics, and why courses are taught in the subject.
Does a soution exist? Possibly. This will typically either involve learning why your matrix becomes singular, Is this an issue of the problem you are solving? Poor data perhaps? A poorly formulated problem? Poorly written code? A poorly scaled problem? Just a nasty problem to solve? Are you trying to solve a big problem with insufficient information? Who knows? We are not omniscient, and our MATLAB crystal ball cannot see into your computer or your mind.
If it is one of the above issues, then you may be able to fix it by getting better data, by improving the algorithm, by rescaling the data, by getting more or better data. We cannot know.
Can you use a pseudo-inverse in some way to deal with it? Again, it is possible, but of course, we are given no clue as you your code, what algorithm is even involved, nothing.
If you are willing to show ALL of your code, explain what you are doing AND provide any data to run the code, we MAY be able to help.
You probably need to sit down with someone who has the expertise to undertand what you are doing. This may be your thesis advior, your boss, a colleague. Explain clearly what you are trying to do. Show them what you see as the problem.
But unless you are willing to provide considerably more information, I'm sorry, but working with a singular matrix is like dividing by zero.
  1 件のコメント
HN
HN 2020 年 10 月 27 日
編集済み: HN 2020 年 10 月 29 日
Below is the program.
close all;
clearvars
t=0:ts:1;
for k=1:length(t)
th(k)=-0.2*cos(2*pi*t(k));
psi(k)=0.2*sin(2*pi*t(k));
end
end

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Programming and Mixed-Integer Linear Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by