finding max value in an array

someone please show me a code or function for finding the maximum value in a vector or array...?

 Accepted Answer

doc max

6 Comments

but this dose not show the index corresponding to which we have max value, is there any other source for finding max value that give the index number also...?
It's on the documentation, type doc max and read, you find this:
[C,I] = max(A) finds the indices of the maximum values of the array or vector A, and returns them in output vector I. If there are several identical maximum values, the index of the first one found is returned.
Please read the MATLAB Documentation, just type the word doc follow by the function you want to use and execute, MATLAB shows you all you need to know about the function and almost every time with good examples on how to use that function.
DOCSEARCH help to find a function for a specific task:
docsearch max
thank you dear you have been very helpful to me... :)
actually i am new user of matlab.. :) i hope i will learn much in just few days.. :)

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!