Simple MATLAB- how to find indices of max element in matrix?

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 21K views
mikeph
Messages
1,229
Reaction score
18
Hi,

Say I have a 10x10 matrix, is there a simple code to finding the indices of the maximum value?

I'm trying to use max() but there doesn't appear to be any option of actually returning the index, rather than the value. I don't need the value, just the position.

Thanks,
Mike
 
Physics news on Phys.org
This thread on MATLAB Central should give you a decent answer: http://www.mathworks.com/matlabcentral/newsreader/view_thread/170759