MATLAB: Efficient use of memory

Hello,
If i create a cell with 1000 matrices ( size of each matrix 800*1280), clearing each matrix after using it will speed up calculations ?
Example
A=cell(1000,1);
for i=1:1000
A{i}=rand(800,1280);
end
image=A{1};
image2=A{2}; % I will use image and image2 with other functions
A{1}=[];
A{2}=[];
EDIT
The real use of the cell will be like :
A=cell(1000,1);
parfor i=1:1000
A{i}=function_that_creates_image(800,1280); % image with size 800*1280 px
end
for i=1:number_of_images % number_of_images=1000 in this case
image1=A{1};
image2=A{2};
A{1}=[];
A{2}=[];
% image1 and image 2 will be used then in the next lines
%next lines of code
end
I noticed that calculating components of A in a parfor loop is faster than calculating each component for each loop inside the for loop
Thank you in advance

Best Answer

clearing each matrix after using it will speed up calculations ?
It depends on the available RAM. If the RAM is exhausted and the much slower virtaul RAM is used instead, the speed difference can be factor 100 or higher. As soon as memory is released, the chance gorws, that all data match into the RAM.
Note that
image1=A{1};
creates a "shared data copy", such that only about 100 Bytes are used in addition, while the actual data are shared. Then:
A{1}=[];
does not release the memory directly, but this happens after image1 is overwritten or cleared also.
As Adam, I would expect that creating only the data required for the current iteration is faster. This would avoid to store 998 images in the memory without need.