Perhaps the answer is obvious without it, but may I suggest you include the complete reproducible problem, with all input matrices, vectors, and parameters fully populated?

Does cvx_status show Failed? Failed
The solver failed to make sufficient progress towards a solution, even to within the “relaxed” tolerance setting. The values of cvx_optval and primal and dual variables are filled with NaN. This result can occur because of numerical problems within SeDuMi,

@Mark L. Stone: Thanks for your comments. I have edited my problem and provided the problem statement. I have also checked that the elements of pp (from the matlab part) are also NaN. Note that p_opt (K,N) are optimization variables. Please look at my problem statement and suggest me a way…

As previously requested, please provide all the input data so that your problem may be reproduced. Also, don’t invoke cvx_begin with quiet when you are having difficulty figuring out what is going on - you should want to see information about the solution progress (or difficulties).

Also, in addition to not invoking cvx_begin with quiet, try solving it with all the solvers you have available. Look at the detailed solution progress information they report.

For the record, I am assembling the comments into this answer, which shows the problem to have now been satisfactorily resolved.

Perhaps the answer is obvious without it, but may I suggest you include the complete reproducible problem, with all input matrices, vectors, and parameters fully populated?

Does cvx_status show Failed? Failed The solver failed to make sufficient progress towards a solution, even to within the “relaxed” tolerance setting. The values of cvx_optval and primal and dual variables are filled with NaN. This result can occur because of numerical problems within SeDuMi, often because the problem is particularly “nasty” in some way (e.g., a non-zero duality gap). This is per the CVX User Guide.
Mark L. Stone (28 hours ago)

@Mark L. Stone: Thanks for your comments. I have edited my problem and provided the problem statement. I have also checked that the elements of pp (from the matlab part) are also NaN. Note that p_opt (K,N) are optimization variables. Please look at my problem statement and suggest me a way…
Juan (10 hours ago)

As previously requested, please provide all the input data so that your problem may be reproduced. Also, don’t invoke cvx_begin with quiet when you are having difficulty figuring out what is going on - you should want to see information about the solution progress (or difficulties).
Mark L. Stone (7 hours ago)

Also, in addition to not invoking cvx_begin with quiet, try solving it with all the solvers you have available. Look at the detailed solution progress information they report.
Mark L. Stone (6 hours ago)

@Mark L. Stone: I have solved my problem. In fact, for some of the parameters, the problem was not feasible. Thanks…
Juan (6 hours ago)