Obtain the mean angle (circle mean of a file)

30 views (last 30 days)
Hi, first of all, thank you for reading me, i need something very simple but i can't find a good program to do this...
The average of wind direction data.
i am using matlab 2019a, and have all this data (for a year) and i need the average of this data (attach photo) for every row (this data are in degree, so this not regular mean is circle mean that i need) , so every 10 minutes, so in the end i want to have only one column, i am using meanangle, but i don't obtain good results. don't obtain good results.
if you can help me I would appreciate it too much

Accepted Answer

Bruno Luong
Bruno Luong on 5 Aug 2020
Edited: Bruno Luong on 5 Aug 2020
angledata_deg is your angle data in degree
meanangle_deg = rad2deg(atan2(mean(sind(angledata_deg),2),mean(cosd(angledata_deg),2)))

Sign in to comment.

More Answers (2)

Jessica Langsdale
Jessica Langsdale on 5 Aug 2020
%enter the number of rows here
for i=1:5
Replace all the variables with your stuff. I think this is what you need? I'm not quite sure what you mean by 'circle mean' but this fits the description of the second half of your question.
  1 Comment
Ana Soph
Ana Soph on 5 Aug 2020
But i need the circle mean, not the regular mean, because are degree

Sign in to comment.

KSSV on 5 Aug 2020
num = xlsread(myfile) ; % better use readtable
iwant = mean(num,2) ;

Sign in to comment.


Find more on Get Started with MATLAB 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