How to represent the function "argmin" in matlab?
古いコメントを表示
This function does not present in R2009b package. Is any special way to represent this function in this package.? .
5 件のコメント
Arnab De
2013 年 2 月 24 日
Your questions are not related to the product MATLAB Coder, which is a tool to translate MATLAB programs to C programs. Please do not tag your questions with MATLAB Coder.
Shashank Prasanna
2013 年 2 月 25 日
編集済み: Shashank Prasanna
2013 年 2 月 25 日
Arnab, that information is in general not public knowledge. Infact MATLAB Coder documentation is not even available for public access if they don't own the product license.
I've made the changes to the product for this questions, but you may want to create a new post to create awareness in the forum.
Walter Roberson
2013 年 2 月 25 日
Shashank, the description including purpose of MATLAB Coder is visible to everyone, including those who have no MATLAB Central account and no license. It is at http://www.mathworks.com/products/matlab-coder/
The purpose of MATLAB Coder is public knowledge, and the product has been mentioned many times here in MATLAB Answers.
Sean de Wolski
2013 年 2 月 25 日
編集済み: Sean de Wolski
2013 年 2 月 25 日
@Walter, this reflects a recent change in the documentation policy for some of our products. Try accessing the above incognito or inprivate browsing mode.
Shashank Prasanna
2013 年 2 月 25 日
The documentation is not hidden, but the product description is not.
But anyone, new or otherwise, with a MATLAB question should not be expected to know of the existence of this product or any of the 90 other products MathWorks makes.
This miss-classification is genuine and other forum contributors to help clean up.
回答 (2 件)
Shashank Prasanna
2013 年 2 月 23 日
0 投票
Can you elaborate? argmin means 'argument of the minimum' of a function. Which means you want to perform an optimization.
Check out the following link for information about optimization in base matlab:
7 件のコメント
Shashank Prasanna
2013 年 2 月 23 日
編集済み: Shashank Prasanna
2013 年 2 月 23 日
To answer you question below: argmin is as I defined above, just means minimum of a function for a certain parameter. If c is just a set of constants and not a function then its minimum values will just be
f = min(C)
However if C is a function, you will have to set up an optimization function above. There is no function called argmin because you haven't defined what the 'arg'ument is and what you want o 'min'imize
Walter Roberson
2013 年 2 月 25 日
My interpretation of argmin() is that it is the argument value that minimizes the value of a given function (or expression). This is different than what you describe in your first sentence above, which is the minimum of a function for a given argument value.
Shashank Prasanna
2013 年 2 月 25 日
Walter, what you say is not different from what I mentioned. argument of the minimum of a function does indeed mean the argument at which the function is at its minimum:
It is simply x at which f(x) is at its minimum.
teljo madassery
2016 年 7 月 19 日
sir can you please explain what is argmin of an n dimensional matix
Walter Roberson
2016 年 7 月 19 日
A matrix does not have an argmin.
A function that takes parameters has an argmin, and that argmin is the set of parameters such that the function value at those parameters is no larger than the function value at any other set of parameters.
If the matrix represents the results of evaluating the function over different parameters, then
[minvalue, minidx] = min(TheArray);
will result in minidx being the linear index at which the array has a minima. You can use ind2sub() to convert the linear index into subscripts. If appropriate you can then use those subscripts to index the vectors of parameters that went into making the dimensions. Or just index the grid if you made one.
Example:
[P1, P2, P3, P4] = ndgrid(1:10, 2.5:.3:3.2, -5:.1:5, 7.8:15);
TheArray = YourVectorizedFunction(P1, P2, P3, P4);
[minvalue, minidx] - min(TheArray);
min_was_at = [P1(minidx), P2(minidx), P3(minidx), P4(minidx)];
Mary Nahill
2017 年 10 月 27 日
To return k, the index of the minimum value of V (also called the argmin of V), do this: k = find(V==min(V))
Dhines
2013 年 2 月 23 日
0 投票
1 件のコメント
Shashank Prasanna
2013 年 2 月 23 日
Please comment on the above answer instead of creating a new answer, this way it becomes easier to track correct answers to questions.
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!