if (norm(Ex(:,k) - c_pos(:,k))-2)<=0
d=0;
else d=(norm(Ex(:,k) - c_pos(:,k))-2);
It appears that
“The following error occurred converting from cvxcnst to logical:
Disciplined convex programming error:
Constraints may not appear in if/then statements.”