CVX下载

CVX安装

下载压缩文件后解压缩至任意地址,打开matlab,进入解压缩后的地址,在matlab中输入 cvx_setup,如果出现以下信息,则说明安装成功。

Testing the cvx distribution. If this script aborts with
an error, please report the error to the authors.
-------------------------------------------------------------
No errors! cvx has been successfully installed.

最后需要保存一下路径,在Preferences→General的Toolbox Path Caching里点击update Toolbox Path Cache更新一下,点击Apply即可。

基本用法

  • 查看当前求解器
cvx_solver 
  • 选择求解器
 cvx_solver sedumi
  • 设置精度
cvx_precision low
cvx_precision medium
cvx_precision default
cvx_precision high
cvx_precision best
  • 线性规划问题
n=3;
A=[1 2 3;0 2 4];
b=[10;9];
c=[2 3 4];
lb=[0;0;0];
ub=[10;10;10];
cvx_begin
    variable x(n);
    dual variable y;
    minimize(c*x);
    subject to
        y:A*x==b;
        lb<=x<= ub;
cvx_end

相关文章:

  • 2022-02-02
  • 2022-12-23
  • 2021-04-12
  • 2022-01-13
  • 2021-11-23
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2022-01-15
  • 2021-08-26
  • 2021-10-29
相关资源
相似解决方案