MATLAB: Averaging minute data to hour data

rinex data

Greetings all.
My name is Joseph Moses.
I would like this great house to help me on how to average my data into hour and the hourly averaged data into daily.
For instance,
1.How do i get the corresponding average of 0.00:0.983, 1.000:1.983 till 23.00:23.983 in the second column (VTEC Data) from the below data or the attached.
2. Then plot the result Time against VTEC

Best Answer

Try this:
D = load('bjcoo001-2015-01-01.txt');
M = ceil(D(:,1)+1E-4);
HrMeans = accumarray(M, (1:numel(M)).', [], @(x){mean(D(x,2:4))});
Result = [(0:23).' cell2mat(HrMeans)]
figure
plot(Result(:,1), Result(:,2))
grid
xlabel('Time')
ylabel('VTEC')
producing:
Result =
0 10.8497 2.0272 6.3800
1.0000 8.4937 1.8062 6.3800
2.0000 7.6810 1.1152 6.3800
3.0000 6.0948 1.0160 6.3800
4.0000 3.7198 1.0692 6.3800
5.0000 3.0660 1.1472 6.3800
6.0000 8.8583 0.9718 6.3800
7.0000 18.5332 1.1425 6.3800
8.0000 26.3258 1.4597 6.3800
9.0000 32.8312 1.5363 6.3800
10.0000 39.3363 1.9443 6.3800
11.0000 45.3585 3.1638 6.3800
12.0000 49.2812 3.2907 6.3800
13.0000 51.2610 2.2868 6.3800
14.0000 53.3373 2.2015 6.3800
15.0000 49.9703 4.1498 6.3800
16.0000 45.2548 3.5810 6.3800
17.0000 37.1800 3.4638 6.3800
18.0000 24.5763 3.7843 6.3800
19.0000 16.1022 4.9532 6.3800
20.0000 14.7298 3.7925 6.3800
21.0000 14.8348 4.0482 6.3800
22.0000 13.5453 3.9738 6.3800
23.0000 14.4595 5.1812 6.3800
EDIT —
Added plot image —