MATLAB: How to find the average of an image set

averagematrix

In U<25×1 cell> in each cell consists of < 105 x159 > values i need to find the average of the 25 images how would i find?

Best Answer

v=0;
n=numel(U);
for k=1:numel(U)
v=v+U{k};
end
out=v/n;
%or
out=mean(reshape(cell2mat(U(:))',159,105,[]),3)'