Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Storing the address
Date: Sat, 31 Jan 2009 15:32:01 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 20
Message-ID: <gm1qth$fqu$1@fred.mathworks.com>
References: <glud5p$o60$1@fred.mathworks.com> <glum0q$1nr$1@fred.mathworks.com> <glupfd$fv2$1@fred.mathworks.com> <glvc1q$itr$1@fred.mathworks.com> <glvf7h$m2k$1@fred.mathworks.com> <gm0ht1$m2e$1@fred.mathworks.com> <gm0t3e$n3r$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1233415921 16222 172.30.248.37 (31 Jan 2009 15:32:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 31 Jan 2009 15:32:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:515139


Now that I am a little more awake, I see we can get rid of the second cellfun call:

idx1 = ~cellfun(@isempty,test);
idx2 = repmat(sum(idx1)>1,[size(test,1),1,1]);
idx3 = idx2 & idx1;
[rx,cx,px] = ind2sub(size(idx3),find(idx3));

rx_cx_px = [rx,cx,px]  % The results. 

rx_cx_px =

     2     3     1
     3     3     1
     2     3     2
     3     3     2




\sZll\ls-aY]fNZN'XY\lNFzN[N:lVUblacPlNPOVO[2\TRN]UR\\UbRaRl