Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!12g2000pri.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Simple matrix manipulation question
Date: Thu, 16 Jul 2009 09:22:53 -0700 (PDT)
Organization: http://groups.google.com
Lines: 28
Message-ID: <f83d9ae3-79bf-4717-be07-cb7ac76d00a1@12g2000pri.googlegroups.com>
References: <h3lt89$b6e$1@fred.mathworks.com> <h3m1dc$5gs$1@fred.mathworks.com> 
	<h3njiu$8m6$1@fred.mathworks.com>
NNTP-Posting-Host: 198.206.219.34
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1247761373 13090 127.0.0.1 (16 Jul 2009 16:22:53 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 16 Jul 2009 16:22:53 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 12g2000pri.googlegroups.com; posting-host=198.206.219.34; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) 
	Gecko/20090624 Firefox/3.5,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 wwwproxy-son-ca-02.ca.sandia.gov:80 (squid/2.5.STABLE14)
Xref: news.mathworks.com comp.soft-sys.matlab:556007


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