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 VectorMr = reshape(M, 24, []); % Reshape VectorMeanMr = mean(Mr); % Take Column Means. Related SolutionsMATLAB: Monts in year sequence, string, matrix Convert to a timeseries() object and use retime()Or:Data = rand(365,1);Data_timestamp = datetime(2021, 1, 1:365).'; %use non-leap year !month_totals = accumarray(month(Data_timestamp), Data)month_totals = 12×1 17.6917 12.5502 14.1349 17.2993 14.2127 17.4742 16.3479 14.0845 13.4153 15.4119 MATLAB: Converting data from minutes to hours >> data_minute = rand(180, 1); % synthetic data>> data_hour = mean(reshape(data_minute, 60, [])) Related QuestionFibonacci sequence, slightly different.I have a Matrix of 7320×8 and need to sum every 24 rowsAverage of 3d matrixFunction index is a string, whyHourly average of multiple column dataReplacing nan values with the mean of a moving window
Best Answer