How to find average monthly wind velocity values for given years?
13 ビュー (過去 30 日間)
古いコメントを表示
I am new to MatLab and trying to create an average monthly wind velocity array for three separate years (2017-19), which I can then plot against each other and finally calculate the accumulated monthly mean from 2017-19.
This is the table formatting
How would I separate each year and determine the monthly mean wind velocities, which I can then insert into a line chart such as this (below) showing each year?
3 件のコメント
採用された回答
Adam Danz
2021 年 2 月 26 日
Use groupsummary to compute the means for 12 months across all days/years.
Demo:
T = table((1:10)', randi(12,10,1), 2017.*ones(10,1), randi(20,10,1)+200, rand(10,1)*20, ...
'VariableNames', {'Day','Month','Year','WindDirection','WindSpeed'})
groupsummary(T,'Month','mean',{'WindDirection','WindSpeed'})
2 件のコメント
Naseef Muhammed
2022 年 9 月 9 日
Taking arithmatic means of wind direction is wrong. For example, based on 'groupsummary' average of 358 and 6 degree will results in 182 which is abselutely wrong.
Adam Danz
2022 年 9 月 16 日
@Naseef Muhammed, true, for circular data you'd want to compute the circular average.
Note that the demo data in my answer are all within the interval [200:220] so the regular old mean would return the same as the circular mean in this case.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!