Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!v3g2000hsc.googlegroups.com!not-for-mail
From: Ross <fed.rossi@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sub-min
Date: Mon, 18 Feb 2008 20:55:15 -0800 (PST)
Organization: http://groups.google.com
Lines: 18
Message-ID: <b21b9772-12c9-4842-a58e-34c1fc28faff@v3g2000hsc.googlegroups.com>
References: <3d8a1aea-b86f-4987-aea9-0c2420ee73e5@i29g2000prf.googlegroups.com>
NNTP-Posting-Host: 165.124.162.173
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1203396925 16123 127.0.0.1 (19 Feb 2008 04:55:25 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 19 Feb 2008 04:55:25 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: v3g2000hsc.googlegroups.com; posting-host=165.124.162.173; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.4) 
Xref: news.mathworks.com comp.soft-sys.matlab:452274


On Feb 18, 7:43 pm, Ross <fed.ro...@gmail.com> wrote:
> Hi everyone,
>
> I have two 2-dim arrays, A and C. C is zeros and ones.
> I and want to find min(A, [ ] , 2), but only considering elements that
> are ones in matrix C.
>
> Do you know a fast way to compute this in matlab?
>
> Thank you!
> Ross

ok, I guess I will go with the brute force:

a = max(max(A));
Ca = C.*a;
Amin = min(Ca+A,[ ],2);