Optimization of dot product of Matrix and vector

6 ビュー (過去 30 日間)
Stepan
Stepan 2017 年 2 月 15 日
I have a matrix M (7 columns and 100 rows). I have a function fn(M*L), where L is vector of 7 values. I want to find L for wich function is minimal. I used fminbnd(), but it did not work correctly. The problem is that function gave same result for collinear vectors (both parallel and anti parallel), moreover the length of vector is also not important (vectors [1 1 1 1 1 1 1] and [2 2 2 2 2 2 2] will give the same results). Could you help me to constrain L to avoid these problems?

回答 (1 件)

Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017 年 2 月 15 日
Sounds like you only care about the direction of L and not length. So instead of minimising f(M*L), you could minimise f((M*L)/norm(L)).
  2 件のコメント
Stepan
Stepan 2017 年 2 月 15 日
You are absolutely correct. I am interested only in direction, but if i will minimize L for f((M*L)/norm(L)), I will have the same problems vectors [1 1 1 1 1 1 1] and [2 2 2 2 2 2 2] will give the same results. The problem is how to constrain L for minimization.
Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017 年 2 月 15 日
Can you tell us why you think fminbnd() did not work correctly? I'm not sure the problem you're having has to do with L being non-unique. But if you want to constrain L, you could try using fmincon() and define a nonlinear constraint NONLCON @(x) mycon(x) where:
function [c,ceq] = mycon(x)
c = [];
ceq = norm(x) - 1;
to fix |L|= 1

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOptimization についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by