2012-02-21 21 views
0

実行:結果 MATLAB:fminconは最小値を見つけることができません

function test() 

Aeq = ones(1,4); beq = 1; 
a0 = [.2,.2,.2,.1]; 
[a,f] = fmincon(@ttest,a0,[],[],Aeq,beq); 

:私は 't検定' をテストした

Warning: Trust-region-reflective algorithm does not solve 
this type of problem, using active-set algorithm. You 
could also try the interior-point or sqp algorithms: set 
the Algorithm option to 'interior-point' or 'sqp' and 
rerun. For more help, see Choosing the Algorithm in the 
documentation. 
> In fmincon at 472 
    In test at 6 

Local minimum found that satisfies the constraints. 

Optimization completed because the objective function is non-decreasing in 
feasible directions, to within the default value of the function tolerance, 
and constraints were satisfied to within the default value of the constraint tolerance. 

<stopping criteria details> 

は、それが正常に動作します.....ない、かなり警告を理解する~~なぜそれは機能しないのですか?

+0

'ttest'関数はどのように見えますか? – macduff

答えて

1

ローカルミニマム化に成功:Local minimum found that satisfies the constraints. afの値を確認してください。

すべての警告は、あなたが作業している問題に対してデフォルトアルゴリズムが機能しないことを伝えているので、別のものを選択します。使用できるさまざまなアルゴリズムについては、下部にあるfminconのドキュメントを参照してください。あなたは、使用するアルゴリズム、具体的にそれを伝えることで、この警告を取り除くことができます。

Aeq = ones(1,4); beq = 1; 
a0 = [.2,.2,.2,.1]; 
options = optimset('Display', 'iter', ... 
        'Algorithm', 'active-set'); 
[a,f] = fmincon(@ttest,a0,[],[],Aeq,beq,[],[],[],options); 

私もそれは、私は常にデバッグフェーズに役立つ何かをその反復を表示するように指示しました。使用可能なさまざまなオプションについては、hereを参照してください。

関連する問題