Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: N-dimensional find
Date: Fri, 8 May 2009 09:21:50 -0400
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <gu1bl0$9r8$1@fred.mathworks.com>
References: <gnhibi$s1m$1@fred.mathworks.com> <gnhrhd$llc$1@fred.mathworks.com> <gni2rp$3ja$1@fred.mathworks.com> <gu171n$rg$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1241788896 10088 144.212.105.187 (8 May 2009 13:21:36 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 8 May 2009 13:21:36 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:538497



"Andrew Jackson" <andrewj@eml.cc> wrote in message 
news:gu171n$rg$1@fred.mathworks.com...
> "Sven" <sven.holcombe@gmail.deleteme.com> wrote in message 
> <gni2rp$3ja$1@fred.mathworks.com>...
>> Thanks all,
>>
>> The short-term solution I've chosen which has cleaned up my code quite a 
>> bit is a combination of suggestions:
>> BW = rand(10,20)>.8 % Make the image
>> [A, B] = max(BW) % Hijack the max function
>> B(BW(B==1)==0) = 0 % Account for all-zero columns
>>
> ...
>
> If anyone is trying to use this neat trick with *sparse* logical matrices 
> in R2009a, be aware that a MATLAB bug causes a crash:
>
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/246673

FYI, that's bug report 529803 if you want to track it.

http://www.mathworks.com/support/bugreports/

*snip*

-- 
Steve Lord
slord@mathworks.com