MATLAB: I have 5*10*9000 matrix. how can I average each 5*10 slices to get 9000 * 1 matrix. Please any helper? thanks mean 3D to 1D Best Answer See if this does what you want:M = rand(5,10,9000); % Create DataMR = reshape(M, [], size(M,3)); % Reshape To 2DOutput = mean(MR,1).'; % Result Related SolutionsMATLAB: Combine 3x3D into 4D matrix Easiest:permute(cat(4,M1, M2, M3), [1 4 2 3])less memory perhaps:cat(2,reshape(M1, 5000, 1, 10, 100), reshape(M2, 5000, 1, 10, 100), reshape(M3, 5000, 1, 10, 100)) MATLAB: Split a larger matrix into smaller matrices The dimensions have to add to the same values in each dimension with mat2cell.This works:M = randi(9, 256, 5, 2000); % Create MatrixC = mat2cell(M, 256, ones(1,5), 2000); % Split To Cells Related QuestionExtend a 20×1 structure to be a 20×10 structureWhere is “RUN GROUP SIMULATION” in Simbiology Version 5.10 (R2020a)I have a 20×1 vertical matrix. I want to take the averages of the pairs in order and display them in another matrix. How3-D matrix operations10%+10%
Best Answer