running mean of circular data (angles)

조회 수: 36 (최근 30일)
Jakob Sievers
Jakob Sievers 2011년 10월 5일
댓글: Walter Roberson 2020년 5월 7일
Hi there
Im trying to do a running mean of a quite large wind-direction data-set but I'm having trouble finding solutions that work. Does anyone know of a simple solution?
Thanks in advance

채택된 답변

Mark Brandon
Mark Brandon 2011년 10월 5일
You could look at the excellent "Circular Statistics Toolbox"
  댓글 수: 5
Ana Soph
Ana Soph 2020년 5월 6일
  1. how can i use mean angle?
  2. M = xlsread('Dic2019','Dic2019mat')
  3. ten_minute_avarege = meanangle(reshape(M, 10, []), 'omitnan')
  4. xlswrite('datosexcel1.xlsx', ten_minute_avarege, 'Hoja1', 'A1');
Walter Roberson
Walter Roberson 2020년 5월 7일
I am not aware of any meanangle() function that has 'omitnan' as an option.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

David Young
David Young 2011년 10월 5일
Have a look at
doc unwrap

Jakob Sievers
Jakob Sievers 2011년 10월 5일
The Circular Statistics Toolbox doesnt appear to have a running mean function though. I have used its circ_mean function to make my own running mean but it takes hours to complete its calculation due to the size of the dataset (basically a long vector containing 10 million points).
Does anyone have any other suggestions?
  댓글 수: 4
David Young
David Young 2011년 10월 5일
Note that unwrap assumes your angles are in radians. If you're using degrees (and from the 360 in your code I think you are), multiply your data by pi/180 before using unwrap. You can convert back afterwards if necessary by multiplying by 180/pi.
Also, perhaps there's a problem with runmean. Maybe you could explain a little more about what this function does, or if it's very short even copy it into your question. (Not into a comment or answer though.)
Jakob Sievers
Jakob Sievers 2011년 10월 5일
Hi David
I just talked with a colleague who said that a 30min mean would be sufficient, meaning that I can make a simple running mean that runs in a 20 seconds or so myself using the circ_mean as described above. Thanks for the help though!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by