Can we easily find peaks in CVX? Thanks

Hi experts,

      Today is my second day using CVX and I am wondering if I can use CVX to optimize below problem: wH is the only variable, s_H is a given matrix. I want to find the second highest peak of the abs(wH'*s_H) and then minimize this second peak. Matlab has a function called" findpeaks" but I cannot use here since this function does not accept cvx variables. I can also write a findpeak function but I am not sure whether CVX will accept that either. Can I get some advice on how to easily achieve peak finding which is suitable for CVX? Many thanks! 


variable wH(N,1) complex

SLL_h=sort(SLL_h, ‘descend’);



error message on findpeaks function:

Error in findpeaks>parse_inputs (line 199)

abs(wH’*s_H) is a convex function. Trying to find peaks, i.e., (local) maxima, of a convex function is a non-convex problem. Therefore, CVX is not suitable for the task.