This is my first time using CVX with Gurobi to solve a problem.And I want to see how it works with a simple example. The following is the example that I am trying:
% Matlab code
m=1
cvx_begin
variable x(1)
minimize( x(1) )
subject to
2<=x(1)
cvx_end
However, I got the error ‘Cannot use a value of type struct as an index.’, and additional info is as followed:
Calling Gurobi 9.00: 1 variables, 1 equality constraints
------------------------------------------------------------
------------------------------------------------------------
Status: Error
Optimal value (cvx_optval): NaN
Cannot use a value of type struct as an index.
Error cvxprob/solve (line 435)
[x, status, tprec, iters] = shim.solve( At, b, c, cones, quiet, prec, solv.settings, eargs{:} );
Error cvx_end (line 88)
solve( prob );
Error ArrayDesignTst (line 51)
cvx_end
Is there any way to fix this issue? Thanks!