From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: if statements - drastic difference in running time
Date: Fri, 23 Mar 2012 02:18:13 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <jkgmh5$9i0$>
References: <jkf6uj$ni$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1332469093 9792 (23 Mar 2012 02:18:13 GMT)
NNTP-Posting-Date: Fri, 23 Mar 2012 02:18:13 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:761897

"MaxEOE" wrote in message <jkf6uj$ni$>...
> I have encountered the following odd behavior I have no explanation for:
> ........
- - - - - - - - - -
  You should be collecting the sum of the ten j-values at the point where the 'break' occurs, which will give you the total number of trips through the inner loop.  On my machine when I take the ratio of that sum to the tic-toc time it varies very little from one run to another and between query 1 and 2.  Try this on your machine.

  Remember, 10 is not a very large number and there should be considerable variation in the above sum, which might conceivably account for your observations.  If not, then you would have a much more convincing case to present to MathWorks' experts.

Roger Stafford