Plot multiple irradiances as one average
Mostrar comentarios más antiguos
I am plotting the hourly irradiances of every month, but now I need to plot the hourly average irradiance over the month. I don't know how to do it - I'm very new to MATLAB. Any help would be appreciated :)

Respuestas (2)
Cris LaPierre
el 4 de Abr. de 2023
You haven't shared your data, which will impact how this can be done, but I suggest looking into groupsummary. In particular, if your time data in a datetime, you can set the groupbin option to 'month' and your method to 'mean', which will create an output table with the hourly average of the indicated 'datavars' table variables.
Perhaps it would look something like this. Untested, so just for show.
data = readtable(...)
data.Date = datetime(data.YEAR,data.MO,data.DY,data.HOUR,zeros(heigh(data),1),zeros(height(data),1));
Mavg_data = groupsummary(data,"Date","month","mean","irradiance")
plot(Mavg_data.month_data,Mavg_data.mean_irradiance)
Image Analyst
el 4 de Abr. de 2023
0 votos
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Categorías
Más información sobre Time Series Events en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!