Question: PYTHON Write a function that accepts a matrix A and vector b and solves the following problem. minimize ||Ax-b|| 2 subject to ||x|| 1 =1
PYTHON
Write a function that accepts a matrix A and vector b and solves the following problem.
minimize ||Ax-b||2
subject to ||x||1 =1
x=>0
To test the function, use
and
The minimizer is approximately x=[0,1,0,0] with objective value 5.099. Hint: norm() is a convex function, so a different way is needed to take the 1-norm.
A= A 1 2 1 1 0 3 -2 -1 b 7 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
