thank you, I wrote this and I get an error
Error using .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {positive constant} ./ {real affine}
Error in ./ (line 19)
z = times( x, y, ‘./’ );
Error in harmmean (line 28)
m = 1 ./ mean(1./x, varargin{:});
Error in Q2 (line 21)
u <= harmmean([g.*x,h.*y],2)
N = 10;
g = ones(N,1);
h = ones(N,1);
cvx_begin
variable x(N,1) nonnegative
variable y(N,1) nonnegative
expression u(N,1)
maximise sum_log(1+u)
subject to
u <= harmmean([g.*x,h.*y],2)
sum(x + y) == 5
cvx_end