There are a lot of confusing things here. Your graphic does not clearly convey what the problem to be solved is. And your attempted solution is so mixed up that it only serves to further confuse what the problem is which you want to solve.
b a constant (30.46) or is it an optimization variable to be minimized? If the latter, it needs to be declared as a (CVX) variable. And of course,
b is a very different objective function than
norm(w), so you need to figure out what the objective actually is.
The values of M and N must be set before they are used in a variable declaration. I believe your variable
w is supposed to be a complex column vector (it appears so based on everything else), in which case the 2nd dimension must be one (not M+1). I leave you to check what the 1st dimension should be.
I believe your inequality should use
abs. Presumably, this constraint is supposed to hold (be specified) for each of several values of
s, and if so, I will have to defer to you as to whether your double for loop correctly indexes over all occurrences.
You don’t need to declare z1 and z2 as expressions. Equality constraints need to use
= . So your equality constraint should be something like
w'*dot_beampattern_sv(RT,thetaT) == (M+1)*(2*N+1)
If, as appears to be the case, there is only one instance of this constraint, i.e., one value of t for which the constraint must hold, then it should not be inside the for loops.
This should be enough to get you started on fixing up your program. There may be more to fix than what I have indicated. You may also want to re-read the CVX Users’ Guide http://cvxr.com/cvx/doc/ .