argmax of vector in matlab

6 ビュー (過去 30 日間)
Mohamed Jamal
Mohamed Jamal 2020 年 5 月 20 日
回答済み: Raunak Gupta 2020 年 5 月 28 日
Hi guys, Im searching if there's argmax in matlab for this term W*V , argmax(W*V) related to W (v is constant and W is variable so argmax is related to W) .. W and V are vectors ... any help how can I find the maximum vector of W that maximaize the term W*V ? thanks alot !!!!
  1 件のコメント
James Tursa
James Tursa 2020 年 5 月 20 日
This is not clear. If V and W are both vectors, what do you intend the operation W*V to produce? Is this supposed to be an inner product or outer product? What are the sizes of V and W?

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

回答 (1 件)

Raunak Gupta
Raunak Gupta 2020 年 5 月 28 日
Hi,
From the question I understand you have a vector V that is constant, and you are taking dot product with a vector W, assuming both have same length. This operation of finding maximum value of that term cannot be called as argmax instead it’s looks as an optimization problem where you need to maximize W.*V given V and there is no constraint on W.
Since, you didn’t mention any constraint on values inside W, logically I can say that maximum can be infinity by setting W accordingly. For these maximization problems ideally, you need constraint on vector that needs to be calculated.
You can setup the optimization problem as mentioned here using fmincon. Since you want to maximize the value you can put a negative on full objective function because fmincon minimizes the objective function by default.
Hope it helps!

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by