test for cvx library in matlab - windows

Download the zip file of cvx

http://cvxr.com/cvx/download/ by downloading cvx-w64.zip

Require a licence for academic use

a file named cvx_license.dat

Install with licence

unzip the zip file into the toolbox directory ($MatlabRoot\toolbox)

test for cvx library in matlab - windows

run the command in matlab after entering the directory of cvx (adding the path of licence file)

>> cvx_setup E:\software\MATLAB\R2014a\toolbox\cvx\cvx_license.dat

Then

---------------------------------------------------------------------------
CVX: Software for Disciplined Convex Programming (c)2014 CVX Research
Version 2.1, Build 1112 (ef41608) Sun Oct 2 17:15:09 2016
---------------------------------------------------------------------------

Test with simple script

cvx_test.m

 m = ; n = ; p = ;
A = randn(m,n); b = randn(m,);
C = randn(p,n); d = randn(p,); e = rand;
cvx_begin
variable x(n)
minimize( norm( A * x - b, ) )
subject to
C * x == d
norm( x, Inf ) <= e
cvx_end

run the script

 >> cvx_test

 Calling SDPT3 4.0:  variables,  equality constraints
For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------ num. of constraints =
dim. of socp var = , num. of socp blk =
dim. of linear var =
dim. of free var = *** convert ublk to lblk
*******************************************************************
SDPT3: Infeasible path-following algorithms
******************************************************************* ------------------------For abbreviatin --------------
rel. primal infeas (scaled problem) = 2.01e-09
rel. dual " " " = 6.95e-10
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 1.5e+00, 4.5e+00, 6.4e+00
norm(A), norm(b), norm(C) = 1.8e+01, 2.0e+00, 6.3e+00
Total CPU time (secs) = 0.07
CPU time per iteration = 0.01
termination code =
DIMACS: 2.0e-09 0.0e+00 1.2e-09 0.0e+00 6.3e-09 6.2e-09
------------------------------------------------------------------- ------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +4.29018
上一篇:Velocity 局部定制模板


下一篇:java 堆栈分析4