Using gurobi with cvx

First,I finisihed the installation cvx in matlab by downloading the cvx package including the gurobi in “http://cvxr.com/”. Then I use “cvx_grbgetkey” to finish the configuration of Gurobi. Finally, the cvx can find the Gurobi solver successfully. But it displays the error “Model.quadcon must be a struct array with fields q, and rhs error in CVX”, I know that there is mismatching problem between the Cvx version and Gurobi version possibly through searching online. Therefore, I try to download Gurobi 9.0.0 package individually and then configure as before.
Now I run “cvx_grbgetkey ****”,it displays
cvx_grbgetkey 4488f556-71f5-11ec-a97b-0242ac120003


CVX/Gurobi license key installer

Contacting the Gurobi Optimization license server…done.
The attempt to retrieve the license key failed with the following error:

info  : grbgetkey version 9.0.0, build v9.0.0rc2

info : Contacting Gurobi key server…
info : Key for license ID 749316 was successfully retrieved
info : License expires at the end of the day on 2022-03-10
info : Saving license key…
info : License 749316 written to file C:\Users\nxd\AppData\Local\Temp\tp2fe9d554_dbb8_4a6c_a193_fa749df32f17\gurobi.lic

For information about this error, please consult the Gurobi documentation

http://www.gurobi.com/documentation/5.5/quick-start-guide/node5

Once you have rectified the error, please try again.

警告: 转义字符 ‘\U’ 无效。有关支持的特殊字符,请参阅 ‘doc sprintf’。

位置:cvx_grbgetkey (第 338 行)
info : grbgetkey version 9.0.0, build v9.0.0rc2
info : Contacting Gurobi key server…
info : Key for license ID 749316 was successfully retrieved
info : License expires at the end of the day on 2022-03-10
info : Saving license key…
info : License 749316 written to file C:---------------------------------------------------------------------------
Now that the license has been retrieved, please run CVX_SETUP to configure
CVX to use the Gurobi solver with the new license.


When I run “cvx_setup”, it displays
cvx_setup


CVX: Software for Disciplined Convex Programming ©2014 CVX Research
Version 2.2, Build 1148 (62bfcca) Tue Jan 28 00:51:35 2020

Installation info:
Path: E:\matlab\anhzuang\R2020b\bin\cvx
MATLAB version: 9.9 (R2020b)
OS: Windows 10 amd64 version 10.0
Java version: 1.8.0_202
Verfying CVX directory contents:
WARNING: The following files/directories are missing:
E:\matlab\anhzuang\R2020b\bin\cvx\sedumi.travis.yml
These omissions may prevent CVX from operating properly.
WARNING: The following extra files/directories were found:
E:\matlab\anhzuang\R2020b\bin\cvx\gurobi\w64\gurobi.lic
These files may alter the behavior of CVX in unsupported ways.
Preferences:
Path: C:\Users\nxd\AppData\Roaming\MathWorks\MATLAB\cvx_prefs.mat
License host:
Username: nxd
Host ID: 00ffb8c01448 (eth4,10.15.0.201)
Installed license:
Organization: zhejiang university of technology
Contact: Xiaodie Niu (2112003138@zjut.edu.cn)
License type: academic
Named user: nxd
Host ID: 00ffb8c01448
Expiration: 2023-01-10 (363 days remaining)
Status: verified

Setting CVX paths…already set!
Searching for solvers…警告: 转义字符 ‘\c’ 无效。有关支持的特殊字符,请参阅 ‘doc sprintf’。

位置:cvx_gurobi
位置: cvx_gurobi
位置: cvx_setup (第 83 行)
警告: 转义字符 ‘\c’ 无效。有关支持的特殊字符,请参阅 ‘doc sprintf’。
位置:cvx_gurobi
位置: cvx_gurobi
位置: cvx_setup (第 83 行)
5 shims found.
3 solvers initialized (* = default):
Mosek 9.1.9 {cvx}\mosek\w64

  • SDPT3 4.0 {cvx}\sdpt3
    SeDuMi 1.3.4 {cvx}\sedumi
    3 solvers skipped:
    GLPK
    Could not find a GLPK installation.
    Gurobi unknown {cvx}\gurobi\w64
    Gurobi error 10012: Unable to open Gurobi license file 'E:
    Gurobi_2 unknown E:\GURO\anzhuang\win64\matlab
    Gurobi error 10012: Unable to open Gurobi license file 'E:
    Saving updated preferences…done.
    Testing with a simple model…done!

To change the default solver, type “cvx_solver <solver_name>”.
To save this change for future sessions, type “cvx_save_prefs”.
Please consult the users’ guide for more information.

I am very happy that the problem is solved when I use the Gurobi 9.1.2 with Cvx 2.2.