% Define variables
x1 = sdpvar(1);
x2 = sdpvar(1);
x3 = sdpvar(1);
x4 = sdpvar(1);
t = sdpvar(1);
% Define constants (you may need to assign specific values)
c1 = 9; % Example value, adjust as needed
c2 = 100; % Example value, adjust as needed
% Set up the constraint using logsumexp
constraint = logsumexp([x1 - 2*x2 + log(c1), x3 - 6*x4 - log(c2)]) <= t;
% Define the objective
objective = t;
% Set up the optimization problem
ops = sdpsettings('solver', 'mosek'); % Specify MOSEK as the solver
problem = optimize(constraint, objective, ops);
% Check the result
if problem.problem == 0
disp('Solved successfully');
optimal_t = value(t);
optimal_x = [value(x1), value(x2), value(x3), value(x4)];
disp(['Optimal t: ', num2str(optimal_t)]);
disp('Optimal x values:');
disp(optimal_x);
else
disp('Problem encountered');
end
Particularly, this code give me a bunch of strange error.