MATLAB: How to append a row average to a new matrix arraycell arraysmatrix array I have a 500×500 size matrix and I am trying to get the average of every 5 values in a row to make it a 100×100 matrix. How do I do that? foo = randi(500,500) Best Answer With a little bit of guessing. Does this answer your question?%%foo = randi(500,500);cac = mat2cell( foo, 5*ones(100,1), 5*ones(100,1) );num = cellfun( @(sub) mean(sub(:)), cac );num is <100x100> Related SolutionsMATLAB: Going from 1 x n to n x n matrix repmat(A,100,1)where A is your vector. MATLAB: Average of terms mean(x(1:num)); %where num is the number you want to mean to. Related QuestionHow to subplot multiple tiles that I divided from a satellite image in one figureEfficient slicing of cell arrayExecute matrix in a “for loop”How to convert cell in matrix
Best Answer