From: Rune Allnor <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Speed of "for" loops
Date: Mon, 20 Jun 2011 21:58:12 -0700 (PDT)
Lines: 25
Message-ID: <>
References: <itoibv$e5j$> <itoisp$fdh$>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1308632387 30639 (21 Jun 2011 04:59:47 GMT)
NNTP-Posting-Date: Tue, 21 Jun 2011 04:59:47 +0000 (UTC)
Injection-Info:; posting-host=; 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: comp.soft-sys.matlab:732902

On Jun 21, 12:51 am, "John " <> 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.