Finding Max Value From Matlab Variable
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
rizwan
il 22 Mar 2015
Commentato: Image Analyst
il 22 Mar 2015
Hi Experts,
I have a variable
out
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148206/image.png)
i want to extract the max value and its corresponding cell value i.e 17531 and 3 .....i used max function i.e
a = max(out);
but it is displaying 4 17531.............I dont know why it is showing 4 instead of 3???Please help
0 Commenti
Risposta accettata
Andreas Goser
il 22 Mar 2015
Modificato: Andreas Goser
il 22 Mar 2015
That is a nice one! But in the doc it says
"If A is a matrix, then max(A) treats the columns of A as vectors and returns a row vector of largest elements."
So you maybe want to do something else? Like
[a,ix]=max(out(:,2))
3 Commenti
Andreas Goser
il 22 Mar 2015
If you can provide data and code together, that is easier for me to help. Otherwise I need to make guesses.
Image Analyst
il 22 Mar 2015
This latest question is a duplicate of a different one. One that I responded to in http://www.mathworks.com/matlabcentral/answers/184466-for-loop-issue-in-code#comment_273784
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Startup and Shutdown in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!