Filter löschen
Filter löschen

15 minute averaging of time stamped data

1 Ansicht (letzte 30 Tage)
Vincent Odongo
Vincent Odongo am 9 Okt. 2013
Bearbeitet: Vincent Odongo am 9 Okt. 2013
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

Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by