I want to minimize a funcition that is defined by myself, how should I do?
You must follow all of CVX’s DCP rules. Please read http://cvxr.com/cvx/doc/advanced.html#adding-new-functions-to-the-atom-library .
thank you very much!
But why can’t the following example work?
function [z] = fun(x) z = x^2; end
doesn’t it follow the so called DCP rules?
Place fun in fun.m in your MATLAB path. Then it should work.
oh, yes, thank you for your kind help.
And could you please just give some hint on how to deal with a function like this:
pos(x) + square_pos(pos(-x))