I have mx6 matrix. I want to take average of every 10 values for each column ( avg of 1-10, 11-20, …..). I tried the code below for nx1 vector and it worked. I need a help for that of 6 columns. Thank you.
A = readmatrix('cleanedData.csv');n = 10;s = numel(A);out = nanmean(reshape( [A(:);nan(mod(-s,n),1)],n,[]));avg_data = transpose(out);
Best Answer