Hi, I’m a new user of CVX.

Recently, I wanted to solve the maximum eigenvalue of a symatric matrix X. I know there is a function called lambda_max in CVX that I could use to solve this problem directly. However, I want to program it without this m file, but I failed.

Here is my program:

X = [3,0;0,1];

cvx_begin

variable y(2);

variable t

minimize t

subject to

max(y’ * X * y) <= t

norm(y,2) <= 1

cvx_end

I kindly hope y would be [1,0]’; but actually, after optimization y is around [0,0]’; I don’t know why.

Could you help me to explain it? Sincerely thank you for your help!