### Min-L1 with equality constraints

When x, A, b have real-valued entries, (P1) can be recast as an LP.

% load random states for repeatable experiments

rand_state=1;randn_state=1;rand('state', rand_state);randn('state', randn_state);

N = 512;% signal length

T = 20;% number of spikes in the signal

K = 120;% number of observations to make

x = zeros(N,1);q = randperm(N);x(q(1:T)) = sign(randn(T,1));

% random +/- 1 signal% %SAZ original signal to be recovered

disp('Creating measurment matrix...');A = randn(K,N);A = orth(A')';disp('Done.');

y = A*x;% observations SAZ measurements

x0 = A'*y;% initial guess = min energy

xp = l1eq_pd(x0, A, [], y, 1e-3); % solve the LP

http://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf