How to represent the function "argmin" in matlab?
Afficher commentaires plus anciens
This function does not present in R2009b package. Is any special way to represent this function in this package.? .
5 commentaires
Arnab De
le 24 Fév 2013
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
le 25 Fév 2013
Modifié(e) : Shashank Prasanna
le 25 Fév 2013
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
le 25 Fév 2013
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
le 25 Fév 2013
Modifié(e) : Sean de Wolski
le 25 Fév 2013
@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
le 25 Fév 2013
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.
Réponses (2)
Shashank Prasanna
le 23 Fév 2013
0 votes
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 commentaires
Shashank Prasanna
le 23 Fév 2013
Modifié(e) : Shashank Prasanna
le 23 Fév 2013
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
le 25 Fév 2013
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
le 25 Fév 2013
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
le 19 Juil 2016
sir can you please explain what is argmin of an n dimensional matix
Walter Roberson
le 19 Juil 2016
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
le 27 Oct 2017
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
le 23 Fév 2013
0 votes
1 commentaire
Shashank Prasanna
le 23 Fév 2013
Please comment on the above answer instead of creating a new answer, this way it becomes easier to track correct answers to questions.
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!