由于某种原因, cvx对我来说不能开箱即用。
我使用 windows x64、cvx x64 和 Matlab x64 R2012a
但是当我运行一个简单的例子时(\cvx\examples\quickstart.m)它给了我一个错误:
>> quickstart
has_quadprog = exist( 'quadprog' );
has_quadprog = has_quadprog == 2 | has_quadprog == 3;
has_linprog = exist( 'linprog' );
has_linprog = has_linprog == 2 | has_linprog == 3;
rnstate = randn( 'state' ); randn( 'state', 1 );
s_quiet = cvx_quiet(true);
s_pause = cvx_pause(false);
cvx_clear; echo on
prob = evalin( 'caller', 'cvx_problem', '[]' );
if isa( prob, 'cvxprob' ),
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SECTION 2.1: LEAST SQUARES %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Input data
m = 16; n = 8;
A = randn(m,n);
b = randn(m,1);
% Matlab version
x_ls = A \ b;
% cvx version
cvx_begin
Attempt to reference field of non-structure array.
Error in cvxprob (line 48)
selected = cvx___.solvers.selected;
Error in cvx_begin (line 41)
assignin( 'caller', 'cvx_problem', cvxprob( varargin{:} ) );
Error in quickstart (line 25)
cvx_begin