Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!postnews.google.com!p25g2000hsf.googlegroups.com!not-for-mail
From: Ross <fed.rossi@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sub-min
Date: Tue, 19 Feb 2008 10:25:19 -0800 (PST)
Organization: http://groups.google.com
Lines: 39
Message-ID: <790a015d-4cd3-4dc2-b98f-b7e37953c925@p25g2000hsf.googlegroups.com>
References: <3d8a1aea-b86f-4987-aea9-0c2420ee73e5@i29g2000prf.googlegroups.com> 
NNTP-Posting-Host: 165.124.164.96
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1203445519 386 127.0.0.1 (19 Feb 2008 18:25:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 19 Feb 2008 18:25:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p25g2000hsf.googlegroups.com; posting-host=165.124.164.96; 
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:452458


On Feb 19, 10:32 am, Ross <fed.ro...@gmail.com> wrote:
> On Feb 19, 2:16 am, "us " <u...@neurol.unizh.ch> wrote:
>
>
>
> > Ross:
> > <SNIP jiggling ones and zeros...
>
> > > I have two 2-dim arrays, A and C. C is zeros and ones.
> > > I and want to findmin(A, [ ] , 2), but only considering
>
> > elements that are ones in matrix C...
>
> > i looked at previous solutions in this thread - but still
> > don't understand what you want...
> > can you tell CSSM how the output of these exemplary
> > matrices should look like (assuming i understand your <two
> > 2-dim> correctly)...
>
> >      a=[
> >           10 20
> >           30 30
> >           50 50
> >      ];
> >      c=[
> >           1 0
> >           1 1
> >           0 0
> >      ];
>
> > us
>
> Hi us, thanks for replying.
> To be more precise, c is a matrix of zeros and ones such that sum(c,[],
> 2)>0
> To follow your example, and adding a one to c so that c(3,1)=1,
> the output would be d = [10 30 50]'

ok, I just discovered accumarray, which solves the problem