Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Why are cell arrays so much faster?
Date: Fri, 11 Jul 2008 20:00:23 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <g58e4n$13t$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
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 1215806423 1149 172.30.248.38 (11 Jul 2008 20:00:23 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 11 Jul 2008 20:00:23 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:478924



Below is my experiment - I actually expected the opposite!

>> tic; CubeA(1:300, 1:360, 1) = repmat(1000,300,360); toc
Elapsed time is 0.003197 seconds.
>> tic; CubeB{1} = repmat(1000,300,360); toc
Elapsed time is 0.000964 seconds.

Why is this the case?  

Thanks,

Dave