minimum of a function
古いコメントを表示
Hello sir;
i am trying to find minimum of a function by putting more than one vectors in a single step to get a constant cost value.
bk=magic(4)=[16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1]
function=bk1'*H1'*H1*bk1-2*yr'*H1*bk1;
where yr is a column vector, H1 is a square matrix and bk1 is a column of bk.
i want to put each vector of bk in above function and select the minimum value in a single command.
i tried this one but it doesn't works.
[cost_value, indx]=min(abs(bk(:,[1:end])'*H1'*H1*bk(:,[1:end])-2*yr'*H1*bk(:,[1:end])));
please help
3 件のコメント
John D'Errico
2016 年 3 月 6 日
編集済み: John D'Errico
2016 年 3 月 6 日
As you wrote it, that is not a function. It is an expression. Also, you cannot use the name "function" for a variable name.
If you are trying to find a minimum of a function, use an optimizer. Min is not an optimizer. Tools like fminsearch, fminunc, fmincon are optimzers.
Arif Ullah khan
2016 年 3 月 6 日
Arif Ullah khan
2016 年 3 月 6 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Linear Programming and Mixed-Integer Linear Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!