MATLAB: Sum in sequence, string, matrix

MATLABsequence string matrix

I have a 1×8760 matrix (hours per year). I need to add up 24h and make a 1×365 or 365×1 matrix.
example: sum of values ​​1-24 in 1×1
sum of values ​​25-48 in 1×2 ..

Best Answer

Try this:
M = 1:8760; % Create Vector
Mr = reshape(M, 24, []); % Reshape Vector
MeanMr = mean(Mr); % Take Column Means
.