From: "David Epstein" <>
Newsgroups: comp.soft-sys.matlab
Subject: Is an entry in a matrix largest, or second largest, or ...?
Date: Thu, 29 Mar 2012 17:38:12 +0000 (UTC)
Organization: Univ of Warwick
Lines: 5
Message-ID: <jl26m4$d38$>
Reply-To: "David Epstein" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1333042692 13416 (29 Mar 2012 17:38:12 GMT)
NNTP-Posting-Date: Thu, 29 Mar 2012 17:38:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 319959
Xref: comp.soft-sys.matlab:762612

Let M be a matrix of doubles, and m an entry of M. Then we can find the rank of m in M as sum(M>m) + sum(M==m)/2

What I want to do is to determine the rank of all entries of M. The only way I can think of using arrayfun is to have M as a global variable.

Or is there some better way? Loop??