L1 Minimizaton variation

I have a L1 minimization problem. I was trying to do it using CVX. In Matlab I have
function [ev,x] = L1minimizationV3( A, b, gamma )
% Computes x such that it minimizes the quantity norm(Ax-b,1).
% Uses slack variables

lb=[zeros(n,1);zeros(n,1); zeros(2*m,1)];

I = eye(m);
Aeq = [A,-A,-I,I];
options = optimoptions(‘linprog’,‘Algorithm’,‘dual-simplex’,‘OptimalityTolerance’,1e-10);
xps = linprog(f,[],[],Aeq,b,lb,[],options);

I was going to attempt this as
function L1minizationV4(A, b, gamma)
lb=[zeros(n,1);zeros(n,1); zeros(2*m,1)];

I = eye(m);
Aeq = [A,-A,-I,I];

variable x(n)
dual variable y;
minimize ( f’*x);
subject to y: A * x == b


I am not sure about the rest of the constraints.

Why are you doing all the hard work of constructing f, A, b? Why not use CVX in the way it is intended? For instance, you do know that CVX can do things like norm(x,1) and norm(A*x-b,2), I hope.

Indeed, this is not the correct forum to help you formulate models. That is to say, constructing A, b, and f is outside the scope of this forum. Our focus is on what you’ve done between cvx_begin and cvx_end, and everything there looks just fine.