필터 지우기
필터 지우기

15 minute averaging of time stamped data

조회 수: 1 (최근 30일)
Vincent Odongo
Vincent Odongo 2013년 10월 9일
편집: Vincent Odongo 2013년 10월 9일
I have used the script below to read in my data (Attached) and am able to compute the hourly and daily mean of Heat flux (H) by use of accumarraying the date and time stamps. The difficulty is that I also want to accumarray for 15 minute, 30 minute etc averages. How can one do this with the kind of data I have (See file attached for sample)?
LASfile=fopen('../../data/heat.txt');
Data = textscan(LASfile, '%16c %*24c %s %s %f %f %f %d %d %d %d','headerlines',1);
fclose(LASfile);
H = Data {6};
date_num = datestr(Data{1});
formatIn = 'dd-mmm-yyyy HH:MM:SS';
DateVector = datevec(date_num, formatIn);
Group by day and hour
[unDates, ~, subs] = unique(DateVector(:,1:4),'rows');
% Accumulate by day
[unDates accumarray(subs, H, [], @mean)]; %computes hourly heat flux

답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by