table block growth slow
Show older comments
Hi,
I am trying to fill up a table with mixed data containing cashflows. each mortgage gets multiple lines. Preallocation of a similair table does not seem solve this problem. For preallocation i used repmat to create a table as large as the output containing dummy vars. Because dynamic allocation is complexer to read and gave no performance boost I decided to drop this approach.
The process of dynamically building the table starts out fairly fast but after 35000 iterations, where each adds blocks of about 360 new records, the perfomance decreases very fast. Takes about an hour or more.
enddataset = [dataset;newblock] % dynamic, slows over time
the tictoc slows down. now the weird stuff it that when I use struct it remains fast (11/12 minutes):
myStruct.iterationLabel = newblock. % does not slow over time
As I said using repmat and preallocation does not speed up.
Is it possible to grow a table in a fast manner?
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!