MATLAB: How to save images into a image array and then use it

axesimageimage arrayloopmontage

i have taken plot of images and i need to store it into a image array and then i need to use that array variable as shown below
for i = 1:framerate
axes(handles.axes15);
imshow(lipperimeter);hold(imgca,'on'); plot(imgca,centroids(:,1), centroids(:,2), 'r*','MarkerSize', 10, 'LineWidth', 3);
im = getframe(handles.axes15);
imwrite(im.cdata, fullFileName)
end
this gives an image for a frame so for example 29 images for 29 framerate i have a code were i can save these images into a montage were all individual frames are shown as a single image as
*All i need to do is save the frames as a array of images something like
imgArray=cat(3,image1,image2,image3,...)
i dont know how to write so if any one can help me please*
THAT IS
for i = 1:framerate
axes(handles.axes15);
imshow(lipperimeter);hold(imgca,'on'); plot(imgca,centroids(:,1), centroids(:,2), 'r*','MarkerSize', 10, 'LineWidth', 3);
im = getframe(handles.axes15);
imgArray=cat(3,image1,image2,image3,...) like this is there any way we can save axes image into imageArray
end
montage( cat(4,imgArray{:}) )