MATLAB: How to update a struct array in a for loop

struct arrayupdating

I am determining the equivalent diameter of circles in a series of images.
My code is as follows:
for k = 1:20
I = imread(k);
BW = im2bw(I);
stats = regionprops(BW,'EquivDiameter');
end
I would like the stats struct array to update the values so I get a summary of all the analyzed equivalent diameters, instead of just the last image which is what my code is giving me now. Any ideas?
Thanks,
Mark

Best Answer

Just use indexing to put the data into a non-scalar structure:
stats(k) = ...