Find vector that minimize the matrix equation
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, I want to find vector x of x=[x1,x2,x3,x4,x5] to minimize the value of norm(Ax-b), A is (100,5) matrix and b is (100,1) vector are given. How can I get a vector x that minimize 'norm(Ax-b)+lambda*(sum(abs(x)>0)'? 'lambda' is given constant. I tried 'fminsearch', but it only works for get scalar value.
0 件のコメント
回答 (1 件)
Torsten
2022 年 7 月 9 日
x = A\b
is a vector that minimizes norm(A*x-b).
2 件のコメント
John D'Errico
2022 年 7 月 9 日
Lol. Nope. But close. I wanted to respond the same way at first. Then I noticed that if b is a 5x1 vector, and A is 100x5, then A*x is a 100x1 vector, and it will not be possible to form A*x-b, and therefore the norm is meaningless.
So there is a mistake in the question in some way.
Possibly A is a 5x5 matrix, in which case then norm is a waste of time since the solution is unique.
Or b should have been a 100x1 vector.
Or, something else that I cannot imagine. Perhaps @Jihun Gil does not recognize the problem is meaningless when A is 100x5, x is 5x1n, and b is 5x1.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!