It’s your problem and your input data, so how are we supposed to know? Use real id you want to extract the real part, or it there is an expression which would be exactly real in exact arithmetic, but may have a roundoff level imaginary term if double precision arithmetic. Given that you haven’t declared any variables as complex, everything in your program will already be real, unless some input data is complex. So is the input data complex? Do you want the CVX variables to be complex?
thanks a lot for your reply. its my first time i use cvx and this problem is part of a sub problem in an article. yes i want that my variables be complex. in the objective func the H_01_cvx is a complex matrix and in subject, H_cu_1 and H_cu_2 is complex also.
i wrote again this code and this time i wrote variabe W_1(M,M) complex; and variabe W_2(M,M) complex;
i dont know is it true or not.