Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: how to find a second largest element in a matrix
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: how to find a second largest element in a matrix
Date
Fri, 12 Apr 2013 00:48:29 +0100
mata
y = runiform(10, 10)
_sort((sorted = vec(y)), 1)
sorted[length(sorted)-1]
Nick
[email protected]
On 11 April 2013 22:22, Wu Zhang <[email protected]> wrote:
> Hi there,
>
> Could you help me find the second largest element of a matrix? I know "max" can find the largest one, but for the second largest?
>
> Thanks,
>
> Wu
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/