Find vector that minimize the matrix equation

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.

답변 (1개)

Torsten
Torsten 2022년 7월 9일

1 개 추천

x = A\b
is a vector that minimizes norm(A*x-b).

댓글 수: 2

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.
Oh sorry. I miswrite the size of vector b. b is (100,1) vector.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2022년 7월 9일

댓글:

2022년 7월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by