Manipulate time series matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have a time series matrix like this:
Yr Month Day Hour Min Precipitation-rate
1997 01 01 00 00 0.5
1997 01 01 00 15 0.2
1997 01 01 00 30 0.0
1997 01 01 00 45 0.0
1997 01 01 01 00 0.0
1997 01 01 01 15 0.0
1997 01 01 01 30 0.1
1997 01 01 01 45 0.3
1997 01 01 02 00 0.5
I need hourly data, so I want to sum precipitation values for each full hour, getting this:
1997 01 01 00 00 0.7
1997 01 01 01 00 0.4
There's a practical way to do that on Matlab?
Tks
0 comentarios
Respuestas (1)
Azzi Abdelmalek
el 18 de Ag. de 2016
M=[1997 01 01 00 00 0.5
1997 01 01 00 15 0.2
1997 01 01 00 30 0.0
1997 01 01 00 45 0.0
1997 01 01 01 00 0.0
1997 01 01 01 15 0.0
1997 01 01 01 30 0.1
1997 01 01 01 45 0.3
1997 01 01 02 00 0.5]
[ii,jj,kk]=unique(M(:,1:4),'rows')
out=[ii accumarray(kk,M(:,6))]
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!