根据官网的例子。
可以使用cvx求解
在使用cvx时,两端要添加cvx_begin vcx_end
例程:
m = 16; n = 8;
A = randn(m,n);
b = randn(m,1);
cvx_begin
variable x(n)
minimize( norm(A*x-b) )
cvx_end
运行得到:
Calling SDPT3 4.0: 17 variables, 9 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------
num. of constraints = 9
dim. of socp var = 17, num. of socp blk = 1
*******************************************************************
SDPT3: Infeasible path-following algorithms
*******************************************************************
version predcorr gam expon scale_data
NT 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj