Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!k27g2000yqn.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Speed of "for" loops
Date: Mon, 20 Jun 2011 21:58:12 -0700 (PDT)
Organization: http://groups.google.com
Lines: 25
Message-ID: <24bb88fe-3a99-448f-b3e7-807dbb258fab@k27g2000yqn.googlegroups.com>
References: <itoibv$e5j$1@newscl01ah.mathworks.com> <itoisp$fdh$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 195.18.217.10
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1308632387 30639 127.0.0.1 (21 Jun 2011 04:59:47 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 21 Jun 2011 04:59:47 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: k27g2000yqn.googlegroups.com; posting-host=195.18.217.10; posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: ARLEUHCNK
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
 2.0.50727; InfoPath.2; MS-RTC LM 8; .NET CLR 1.1.4322),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:732902

On Jun 21, 12:51 am, "John " <joh...@gmail.com> wrote:

>  I want to calculate every single possibility, which can be done with loops.

Here all the alarm bells in my mind go off:

1) You *want* to do these computations. That's not an issue;
   what matters is what computations you *need* to do.

   Whenever you use the term 'want', take two and think
   very carefully about what you *need*: Those two are
   usually sufficiently different to make a significant
   impact of feasability.

2) The same goes for the phrase 'all possible combinations'.
   Numbers very quickly grow very large.

   People who use this pharse usually don't know what they
   are doing or why. Instead of spending huge amounts of
   time and efforts computing numbers that tell you nothing,
   make an effort to find those numbers that tell you
   whatever it is you want to find out.

Rune