Considering that datevec() output is stored in tvec and data in x, group with unique(...,'rows') and accumulate with accumarray():% Group by day[unDates, ~, subs] = unique(tvec(:,1:3),'rows');% Accumulate by day[unDates accumarray(subs, x, [], @mean)]% Similarly by hour[unHours, ~, subs] = unique(tvec(:,4:5),'rows');[unHours accumarray(subs, x, [], @mean)] 这篇关于MATLAB:对没有循环的时间序列数据求平均吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-21 09:48