Polynomial into a monomiial
CVX does not allow use of CVX variables or expressions as indices. if a is a CVX expression, it can’t be used as you have attempted.
It appears you want the product of the non-zero elements of a. I think that would be non-convex, in which case you would need to introduce binary variables MIDCP) and use Big M if else logic to handle that. I think that would require establishing a threshold for the smallest magnitude number which is considered to be zero. You can look at https://or.stackexchange.com/search?q=logic+constraints to help you figure out how to do that, or post there for assistance in the modelling (make it an inquiry not tied to CVX).


