In Matlab, I have a class named "point" (which is not a handle class).
I use a loop that creates a cell array of points, making it grow at each iteration without preallocation:
for k=1:npoints
newpoint=point(*some parameters that depend on k*);
pointcell{k}=newpoint; % pointcell grows at each iteration
end
In this example, the cell array "pointcell" grows at each iteration, which may not be optimal in terms of performance.
Is it useful to preallocate this cell array, and if yes how can this be done ?
Just using pointcell=cell(npoints)
doesn't seem to work..