How to represent the function "argmin" in matlab?
Show older comments
This function does not present in R2009b package. Is any special way to represent this function in this package.? .
5 Comments
Arnab De
on 24 Feb 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
on 25 Feb 2013
Edited: Shashank Prasanna
on 25 Feb 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
on 25 Feb 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
on 25 Feb 2013
Edited: Sean de Wolski
on 25 Feb 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
on 25 Feb 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.
Answers (2)
Shashank Prasanna
on 23 Feb 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 Comments
Shashank Prasanna
on 23 Feb 2013
Edited: Shashank Prasanna
on 23 Feb 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
on 25 Feb 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
on 25 Feb 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
on 19 Jul 2016
sir can you please explain what is argmin of an n dimensional matix
Walter Roberson
on 19 Jul 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
on 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
on 23 Feb 2013
0 votes
1 Comment
Shashank Prasanna
on 23 Feb 2013
Please comment on the above answer instead of creating a new answer, this way it becomes easier to track correct answers to questions.
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!