From: Loren Shure on
In article <hqi0s3$t38$1(a)fred.mathworks.com>, isharp2(a)uic.edu says...
> I have heard that tuples are less efficient when compared to pre-allocated matrices.
>
> I was wondering, if the tuples contain pre-allocated matrices, does this slow down computation time?
> I have very elongated tuples, however I seem to get very fast performance still... for instance:
> a = {}
> a{group}{metric}{subject} = zeros(Something, something);
>
> When I add a new group, the entirety of all ..{metric}{subject}[SxS] are not copied??? because they are isolated in their own tuple or not?
>

The contents of each cell in a cell array (the MATLAB equivalent of
tuple) is its own MATLAB array. So adding another cell, or changing one
cell contents doesn't affect the memory use of the rest of the cell
array.

--
Loren
http://blogs.mathworks.com/loren
http://matlabwiki.mathworks.com/MATLAB_FAQ