Path: news.mathworks.com!not-for-mail
From: "Sky Pelletier" <skytoddk@remove14chars.vet.upenn.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: newbie seeks vectorization help
Date: Fri, 9 May 2008 15:42:03 +0000 (UTC)
Organization: University of Pennsylvania
Lines: 27
Message-ID: <g01rcb$28h$1@fred.mathworks.com>
References: <g000e3$eoi$1@fred.mathworks.com> <g01as9$pf6$1@fred.mathworks.com>
Reply-To: "Sky Pelletier" <skytoddk@remove14chars.vet.upenn.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210347723 2321 172.30.248.38 (9 May 2008 15:42:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 9 May 2008 15:42:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1380717
Xref: news.mathworks.com comp.soft-sys.matlab:467610


Thank you for your quick feedback!  I greatly appreciate it.

It seems like I should be able to find a clever way to index
directly at the cost of using more memory, but I just can't
wrap my head around it.  I don't mind too much trading off
memory for speed; this loop occurs inside an application
that ultimately will be run several billion times using
different input parameters, so speed is a priority--but you
think this might actually be the fastest way?  

Is there any way of a priori identifying when vectorization
is NOT a good idea?

Thanks again for your help...

..Sky

"helper " <spamless@nospam.com> wrote in message
<g01as9$pf6$1@fred.mathworks.com>...

> 
> I suspect that using your FOR-loop may in fact be the 
> fastest and most elegant (and most memory efficient) way of 
> doing this.
> 
> This can often be the case with MATLAB.