From: "Jim Simos" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: growing array in Matlab? (new code)
Message-ID: <ef11420.29@webx.raydaftYaTP>
Date: Sat, 20 Aug 2005 09:43:56 -0400
References: <> <> <de2hup$qgu$> <> <ef11420.28@webx.raydaftYaTP>
Lines: 20
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: comp.soft-sys.matlab:297082

Dear John D'Errico,

                 Firstly,many thanks for your growdata function.I
have an algorithm tha need to create a large matrix by continously
appending vectos as rows to the final matrix.My first implementation
involving vertcat with cell arrays was rather slow in comparison to
yours.Some relults for the elapsed time:
Size of matrix A created--> 2114882 rows x 16 columns
My implementation gave about 3600 sec.
When I used your growdata for appending data (with a slight change to
the newrows=200000 instead of 20000 which you had),the elapsed time
was 310 sec.Of course this change is faster for numel(A)>2000000
in my case.
A suggestion,is tha you could integrate an if condition when the
maximum limit of the integer representation is reached,and pack the