Hi everybody:

I have to express the following optimization program with cvx.

What I have done is:

cvx_begin

variable s(N);

for nodo = 1:N,

nieghbors = find(A(:,nodo)); % Neighbors of node ‘nodo’

minimize (y);

subject to

y >= norm([error_v; error_d]).^2;

error_v >= (1/sigma_e)*norm((s(nodo)-red(nodo,3:4)) - v_med(nodo));

error_d >= (1/sigma_l)*abs(d_neighbors - d_med(nodo));

d_neighbors >= norm(s(nodo) - s(neighbors));

end

cvx_end

But I obtain the error ‘y is not defined’.

I know that this error is because the variable ‘s’ is not in the function to minimize, but I don’t know exactly how to include it in this function.

Could you help me, please?

Thanks in advance…