What is wrong with this code?

hello,
what is wrong with this code?

cvx_begin quiet 
variable x(p1,1 )  complex
expression  f2

for kx=1:p1
     fg=g(((kx-1)*M)+1:kx*M);
    f2(:,kx) =diag(fg)*D12(:,kx)*x(kx,1);
end
minimize(.1*norm(g)+sum_square_abs(ya-sum(f2)));
subject to
norm(x,1)<=nu;
cvx_end

Please provide reproducible code, i.e., with numerical values for p1, g, M, D12, ya, nu provided.