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};endout=v/n;%orout=mean(reshape(cell2mat(U(:))',159,105,[]),3)' Related SolutionsMATLAB: I have an array of vectors and I want to convert those vectors into 1 single matrix, each row contains each vector in an array result = vertcat(v{:}); MATLAB: How to create this specified matrix One fast and easy way is to use toeplitz, it only needs one line of code:>> U = 1:9;>> toeplitz(U,[U(1),zeros(1,numel(U)-1)])ans = 1 0 0 0 0 0 0 0 0 2 1 0 0 0 0 0 0 0 3 2 1 0 0 0 0 0 0 4 3 2 1 0 0 0 0 0 5 4 3 2 1 0 0 0 0 6 5 4 3 2 1 0 0 0 7 6 5 4 3 2 1 0 0 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1ortril(toeplitz(U)) Related QuestionHow to shift a fsurf plotHow can i put cell value in a vectorLimits are too largeHow to find a string within a cell arrayHow to shuffle two vectors
Best Answer