2Dimensional search

In the optimal solution with 2D search, the UAV position is obtained by exhaustive searching over all
M × M 2D grid points in the given area, i.e., M = 2000.
my question is what will be its matlab code, how can i find optimal solution using matlab.
please guide me, i’ll wait for your kind reply.


It does not seem to be a CVX related topic. Maybe matlab community is a better place for it.

Ok thanks for your guideline.