Equality constraints should be written with == , not = . But it doesn’t make sense to have y == A*x as a constraint in this problem in which you are trying to minimize the norm (squared) of the deviation from that equality being satisfied.
How about
cvx_begin
variables ln_a b
minimize(norm(log(p) - (ln_a - t*b)))
cvx_end
Thank you, Mark for your response. Is there is any specific reason to use log§ instead of ln§?. Also if I want to satisfied that a>0, a<=1 and b >0, can I use
cvx_begin
variables ln_a b
minimize(norm (log§ - (ln_a - t*b)))
subject to
a>0 && a<=1
b>0
cvx_end
There is no ln function in MATLAB. But log in MATLAB means natural logarithm.
&& is not allowed to be applied to cvx objects. However, you can use 0 <= a <= 1 . Or you can use two separate constraints.
Also note that > and < are interpreted as >= and <= . if you need strict inequality, you need to use non-strict inequality with a “buffer” larger than solver tolerance. For instance, b >= 1e-5.