From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: avoiding loops to built a z matrix of the most efficient form
Date: Wed, 25 Mar 2009 16:24:01 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 3
Message-ID: <gqdlr1$a49$>
References: <gqdj93$qa4$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1237998241 10377 (25 Mar 2009 16:24:01 GMT)
NNTP-Posting-Date: Wed, 25 Mar 2009 16:24:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: comp.soft-sys.matlab:527655

Loops have not been slow in Matlab for several releases now.  OFTEN, running a loop is going to be faster than vectorizing the code.  Not always, but it should definitely not be a surprise to find this is the case in any given situation.

Now, the real question.  Why are you so determined to solve your problem without loops?  Are you looking for a performance boost?  Do you just not like loops?  Is this a requirement for a homework assignment?