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 Comments

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.
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.
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.
@Walter, this reflects a recent change in the documentation policy for some of our products. Try accessing the above incognito or inprivate browsing mode.
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.

Sign in to comment.

Answers (2)

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

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
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.
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.
sir can you please explain what is argmin of an n dimensional matix
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)];
To return k, the index of the minimum value of V (also called the argmin of V), do this: k = find(V==min(V))
Stephen23
Stephen23 on 27 Oct 2017
Edited: Stephen23 on 27 Oct 2017
@Mary Nahill: use the second output of min or max.

Sign in to comment.

in my project am having ranking criteria is c(i)=w(i). "i represents 1 to 50". so 'c' contains 50 elements. and now in my algorithm says these 50 elements further to reduce using ranking procedure and eliminate the smallest rank value. for these elimination process in my algorithm given a formula f=argmin(c).here how to writhe these function in matlab. when i try to write these function in matlab it shows the error.
>> f=argmin(C) ??? Undefined function or method 'argmin' for input arguments of type 'double'.

1 Comment

Please comment on the above answer instead of creating a new answer, this way it becomes easier to track correct answers to questions.

Sign in to comment.

Products

Asked:

on 23 Feb 2013

Edited:

on 27 Oct 2017

Community Treasure Hunt

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

Start Hunting!