Finding Max Value From Matlab Variable

11 次查看(过去 30 天)
Hi Experts,
I have a variable
out
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

采纳的回答

Andreas Goser
Andreas Goser 2015-3-22
编辑:Andreas Goser 2015-3-22
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 个评论
Andreas Goser
Andreas Goser 2015-3-22
If you can provide data and code together, that is easier for me to help. Otherwise I need to make guesses.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by