sparse(A) does not accept char inputs A

Hi,

I am trying to solve following L_1 norm minimization problem using CVX. But I got the given error. What could be the reason for this?

Problem;
Minimize (x,z) || y-H*x-z||_1
subject to ||z||_2 <= epsilon

Here is the code;
cvx begin
variable x(N-1) % N=28
variable z(m) % m=108
minimize (norm(y-H*x-z,1)) % H is a 108 x 27 matrix, y is a vector with 108 element
subject to
norm(z)<=eps;
cvx end

The error is :
Error using sparse
sparse(A) does not accept char inputs A. Use sparse(double(A)) instead.
Error in cvx (line 28)

Thanks

The rather confusing error message is because you used cvx begin . You should use cvx_begin.

Also, you need to use cvx_end , not cvx end .

If you look several topics down the forum, you will see Error using sparse. sparse(A) does not accept char inputs A , which is the very same issue.

Hi,

Thank you for the reply. I will check.