Matlab, for loop code

1 Ansicht (letzte 30 Tage)
assaye gedifew
assaye gedifew am 17 Mär. 2022
Beantwortet: Cris LaPierre am 17 Mär. 2022
I have a series data of hourly and daily climate data of over 10yrs. And what i want to plot them into a graph of mean monthly and in yearly. Can you tell me how to do it in MATLAB? Thank you very much!
  1 Kommentar
Arif Hoq
Arif Hoq am 17 Mär. 2022
attach your data. if possible please try to show your expected result. atleast 2/3 lines

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Cris LaPierre
Cris LaPierre am 17 Mär. 2022
I don't know much about your data, but I would see if groupsummary works. If you have datetime info in your data, you can use the 'groupbin' input to specify a way to automatically group your data ('month' or 'year') and then apply method(s) to each group (e.g. 'mean').
Once you have the summarized data, you can just plot it. See Ch 9 of MATLAB Onramp.
I find this workflow easiest when the data is stored in Tables. See this page on how to access data in tables.

Kategorien

Mehr zu Language Fundamentals finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by