Borrar filtros
Borrar filtros

Manipulate time series matrix

2 visualizaciones (últimos 30 días)
Danilo M
Danilo M el 18 de Ag. de 2016
Editada: Azzi Abdelmalek el 18 de Ag. de 2016
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

Respuestas (1)

Azzi Abdelmalek
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))]

Categorías

Más información sobre String Parsing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by