MATLAB: How to mean multiple matrices, element by element in a n*n cell array mean I've got a data looks like this. size(16*6) cell array. I want to get the average of each columns, but keep the size of each matrice(650*1). Best Answer If I call your cell array C,M=cell2mat(reshape(C,1,16,[]));result = mean(M,2) Related SolutionsMATLAB: Mean over over multiple dimensions and multiple arrays % make dummy data N = 8 ; for i = 1:N C{i} = rand(2,2,3) ; end% get the mean N = length(C) ; [m,n,p] = size(C{1}) ; themean = zeros(m,n,p) ; for i = 1:N themean = themean+C{i} ; endthemean = themean/N ; Can be obtained without loop, using Cell2mat, reshape etc. MATLAB: Median of n*n median(A(:))When you are working in MATLAB, get used to the idea that you can reshape a matrix to perform some operation. Related QuestionHow to resize the element matrix inside a cell arrayHow to construct the n*n matrices, like below:Combine a cell array of cell arrays to a single cell arrayAdjacency matrix formation from n*n matrix
Best Answer