how to sum data every year
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hello
i have a 11322x6 double. i have the date in the first column, months and days in the third and the forth. on the fivth and the sixth colum i have the variables. temperature and degre days that i calculeted from temperature. now i need to sum every degre day of every year together , the problem years change the number evey 4 years so how to do it with a function or easy loop. i saw a lot of them on matlab but don't kenw how to use itnd i don't knew to apply it on my case
0 commentaires
Réponse acceptée
Adam Danz
le 3 Fév 2020
Modifié(e) : Adam Danz
le 6 Fév 2020
No loop needed.
to compute the mean of each group where data is the temperature column.
If your data contain missing values, you can use mu = splitapply(@(x), mean(data,'omitnan'), groups).
Let us know if you get stuck.
2 commentaires
Adam Danz
le 5 Fév 2020
Modifié(e) : Adam Danz
le 5 Fév 2020
Updated comment
You can't apply findgroups to a matrix but you can find unique rows of a table
or you can separate the columns of your matrix and use this syntax
Both of those links will show documentation that describes the syntax and provides examples.
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!