2014-10-04 17 views
2

cvx 어떤 이유로 든 나를 위해 밖으로 작동하지 않습니다.Matlab cvx error with cvx_begin

나는 윈도우 64, CVX의 x64 및 matlab에 64 R2012a

를 사용하지만, 심지어 단순한 예제를 실행하면 (\ CVX의 \ 예는 \ 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 

답변

6

을 설치는 비교적 간단하다 :

  1. 다운로드 CVX (나는 미리 컴파일 된 MEX 바이너리으로 만 무료 해법을 포함하는 cvx-rd.zip 분포를 가지고 모든 지원에 포함 플랫폼).

  2. 은 MATLAB에서 디렉토리에 C:\cvx

  3. 이동 말, 어딘가 ZIP 파일의 압축을 풉니 다, 그리고 cvx_setup 실행 :

    >> cd('C:\cvx\examples') 
    >> quickstart 
    
    :

    이제
    >> cd('C:\cvx') 
    >> cvx_setup 
    
    --------------------------------------------------------------------------- 
    CVX: Software for Disciplined Convex Programming  (c)2014 CVX Research 
    Version 2.1, Build 1088 (e790d80)     Sat Sep 20 22:03:02 2014 
    --------------------------------------------------------------------------- 
    Installation info: 
        Path: C:\cvx 
        MATLAB version: 8.3 (R2014a) 
        OS: Windows 8 amd64 version 6.2 
        Java version: 1.7.0_11 
    Verfying CVX directory contents: 
        No missing files. 
    Preferences: none found; defaults loaded. 
    --------------------------------------------------------------------------- 
    Setting CVX paths...done. 
    Saving updated path...done. 
    Searching for solvers...3 shims found. 
    2 solvers initialized (* = default): 
    * SDPT3 4.0  {cvx}\sdpt3 
        SeDuMi 1.34 {cvx}\sedumi 
    1 solver skipped: 
        GLPK    
         Could not find a GLPK installation. 
    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. 
    --------------------------------------------------------------------------- 
    
  4. 당신이 예제 중 하나를 실행할 수 있습니다

외부 솔버 (Gurobi 및 MOSEK)에 연결하려면 docs의 해당 섹션을 참조하십시오. CVX Professional 라이센스가 필요합니다.