Path: news.mathworks.com!not-for-mail
From: "jcurr Curran" <johncurran20@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Simple matrix manipulation question
Date: Thu, 16 Jul 2009 17:15:20 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <h3nn78$53u$1@fred.mathworks.com>
References: <h3lt89$b6e$1@fred.mathworks.com> <h3m1dc$5gs$1@fred.mathworks.com> <f83d9ae3-79bf-4717-be07-cb7ac76d00a1@12g2000pri.googlegroups.com>
Reply-To: "jcurr Curran" <johncurran20@yahoo.com>
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 1247764520 5246 172.30.248.37 (16 Jul 2009 17:15:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 16 Jul 2009 17:15:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1907356
Xref: news.mathworks.com comp.soft-sys.matlab:556023


This computes the minimum element in each row of A, it's not quite what I was looking for.

Nathan <ngreco32@gmail.com> wrote in message <f83d9ae3-79bf-4717-be07-cb7ac76d00a1@12g2000pri.googlegroups.com>...
> On Jul 16, 9:13?am, "jcurr Curran" <johncurra...@yahoo.com> wrote:
> > Right, but that method involves looping over each i. Is there a way to do this without loops?
> >
> > "Darren Rowland" <darrenjremovethisrowl...@hotmail.com> wrote in message <h3m1dc$5g...@fred.mathworks.com>...
> > > Ok, I see what you want now
> > > c(i) = min( A(1:b(i)) );
> 
> A = magic(10);
> b = [1:10]';
> c = min(A(b,:)')';
> 
> c =
> 
>      1
>      7
>      4
>      3
>      2
>     17
>      5
>      6
>     10
>     11
> 
> How about that one?
> -Nathan