How can i calculate mean wind direction(in degrees) from 1 minute to 10 minutes?

13 views (last 30 days)
Hi everybody, i have a problem, i have a 1 min data of the wind direction(in degrees) of 3 months, but i want the average every 10 minutes of this data.
I have the matlab 2015, so .. i can't use circ.mean.
Can you help me with that, please?
Thank you in advance
Ana Soph
Ana Soph on 6 May 2020
hi, thanks for answering, about your questions...
  1. circ_mean is Mean direction of a sample of circular data (this is what i need)
  2. Yes, is safe to assume that the data definitely starts on an even 10 minute boundary and is definitely every 1 minute
i am waiting your answer, thanks (:

Sign in to comment.

Accepted Answer

Ana Soph
Ana Soph on 7 May 2020
The final script is:
M = xlsread('Dic2019','Dic2019mat')
ten_minute_avarege = meanangle(reshape(M, 10, []), 'omitnan')
A = ten_minute_avarege';
for i=1:length(A)
if A(i)<0, A(i)=A(i)+360; end
A = A(:,1);
A = reshape(A,144,length(A)/144);
xlswrite('datosexcel1.xlsx', A', 'Hoja1', 'A1')
thanks all! :D

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 6 May 2020
If you can be sure that the data starts on a 10-minute boundary and that there is no missing data, then
ten_minute_avarege = mean(reshape(WindData, 10, []), 'omitnan')
If you are sure you have no nan entries, then you can leave out the 'omitnan'

Sign in to comment.


Find more on Weather and Atmospheric Science in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by