Calculate a monthly average from 3-hour data

1 visualización (últimos 30 días)
Oscar Sierra
Oscar Sierra el 4 de Jun. de 2020
Comentada: Oscar Sierra el 4 de Jun. de 2020
Hello everyone!
I'm having a little trouble trying to make a code to calculate the average or the mean for a set of data 90585x1.
This set have information every 3 hours from temperature from 1950 to 2010, I want to make those values a monthly average and after i've got my data set reduced plot.
I was looking to apply a for-lopp or an accumarray don't know how to make this, if anyone could help me, I will be so grateful

Respuestas (1)

David Hill
David Hill el 4 de Jun. de 2020
If you want to simplify slightly, 8 readings * 30 days/month = 240 readings per month ... = 377 months = 90480 readings. Truncate the rest of the readings.
T=T(1:90480);
T=reshape(T,240,[]);
m=mean(T);
  3 comentarios
David Hill
David Hill el 4 de Jun. de 2020
My assumption was that you could just live with every month having 30 days. I am not sure if you can live with that; if not, you code will be more complex.
Oscar Sierra
Oscar Sierra el 4 de Jun. de 2020
I will try with 30 days per month! Thank you so much David!

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by