How to achieve myself function?

Please read this section of the manual and even more importantly, the FAQ. If you cannot build your function according to the limited DCP ruleset, CVX cannot solve it, and that is not a bug.