Effacer les filtres
Effacer les filtres

15 minute averaging of time stamped data

1 vue (au cours des 30 derniers jours)
Vincent Odongo
Vincent Odongo le 9 Oct 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

Réponses (0)

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by