Find vector that minimize the matrix equation
Afficher commentaires plus anciens
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.
Réponses (1)
Torsten
le 9 Juil 2022
x = A\b
is a vector that minimizes norm(A*x-b).
2 commentaires
John D'Errico
le 9 Juil 2022
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.
Jihun Gil
le 10 Juil 2022
Catégories
En savoir plus sur Operations on Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!