Help! How can I achieve low sidelobe array based on phase weighting?

I want to achieve low sidelobe array based on phase weighting. But when I use cvx,I can only use
variables similar to the following express.
cvx_begin
variable weight(NxNy) complex
variable weight(Nx
Ny) real
minimize(norm(weight,2))

This is a CVX forum, not an Electrical Engineering forum. So this is not the right place to ask for help in formulating an optimization problem to address an electrical engineering problem.

If you have a convex optimization problem and need help implementing or reformulating it for CVX, this forum is the right place. it is not clear at all from your code snippet what specific optimization problem related thing you are trying to do that you don’t know how to do. You are allowed to ask for help on this forum for implementing in CVX a convex optimization problem pertaining to use of phase weighting to achieve low sidelobes, but you need to tell what the convex optimization problem model is.

There are CVX example codes Minimize sidelobe level of a uniform linear array via spectral factorization and Minimize sidelobe level of an array with arbitrary 2-D geometry . Whether these are relevant for you needs is for you to determine.

These are two of the example codes in the CVX Example Library .

Thank you for your reply!I still have problems。As the examples show,I can achieve low sidelobes with magnitude and phase both or only magnitude changed。But how can I achieve low sidelobes with phase changed only。

As I wrote before, this is not an Electrical Engineering modeling forum. If you have a convex optimization formulation you need help with, you might get it on this forum. If you need help formulating an optimization problem which addresses some particular engineering design matter, you will have to seek help elsewhere. I’m not an Electrical Engineering or antenna guy, so I can’t offer suggestions as to where you might obtain that help.