I have a code in MATLAB that produces 1000 x 1000 arrays in a loops that runs ten times; to try and save all these loops, I commit these arrays to a cell; Now I have a cell 1 x 10 cell nalled PL, each element being a 1000 x 1000 array; I want to sum these in the easiest way possible, so that I get one 1000 x 1000 output. I've tried using
PLtot = cellfun(@sum,PL, 'UniformOutput',false);
but this does not work at all for me - any ideas? I'm sure this should be simple but having a headache doing it!
Instead of storing your array into cellarray.
Just add an extra dimension to your initial array. Always preallocate the size to the array.
So when you want to access to each image it's easier. And for the sum just do :