MATLAB: Find the mean of every 5 values in an array MATLAB Hi, so I have an array of double b=[ 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0] How do I obtain the mean of every 5 values? Best Answer Lanceric - try using reshape to change your array from a 1x20 to a 5x4 array and then compute the mean from that. For example, mean(reshape(b,[5,4])) Related SolutionsMATLAB: Finding the mean/average of the smallest values in a row To achieve this you can use function min and function meanLets sayA = [1.7 1.2 1.5; 1.3 1.6 1.99]% use min function to get smallest element from each row.M = min(A,[],2)% use mean functionresult = mean(M)Follow the below links for more information:https://www.mathworks.com/help/matlab/ref/min.html#bupsfd_https://www.mathworks.com/help/matlab/ref/mean.html MATLAB: Mean A=rand(76,5); m=mean(A,2); Related QuestionAll possible n-length combinations of two numbersMean vaue every one minuteCombine values from struct.Mean value every 60 rowsDeleting rows of matrix from the rows of other matrix with different dimensionHow to circ_mean every 5 elements
Best Answer