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

14 ビュー (過去 30 日間)
Ana Soph
Ana Soph 2020 年 5 月 6 日
コメント済み: Ana Soph 2020 年 5 月 8 日
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
Best!!!
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 6 日
編集済み: Walter Roberson 2020 年 5 月 6 日
What is "circ.mean" ?
What form is the time information in? Or is it safe to assume that the data definitely starts on an even 10 minute boundary and is definitely every 1 minute?
Ana Soph
Ana Soph 2020 年 5 月 6 日
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 (:

サインインしてコメントする。

採用された回答

Ana Soph
Ana Soph 2020 年 5 月 7 日
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
end
A = A(:,1);
A = reshape(A,144,length(A)/144);
xlswrite('datosexcel1.xlsx', A', 'Hoja1', 'A1')
thanks all! :D
  8 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 7 日
It should work with numeric values, including values that might include nan.
It just is not an intended way of calling meanangle. But it will work because meanangle was sloppy in not checking that the parameters were what the function expected.
Ana Soph
Ana Soph 2020 年 5 月 8 日
oh.. ok, i understand

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 5 月 6 日
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'
  8 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 7 日
You have to download the code from the File Exchange, and unzip it into its own directory that is not under the MATLAB installation directory. Then use pathtool to add that directory to the path, and save.
Ana Soph
Ana Soph 2020 年 5 月 7 日
THANK YOUUUUUU <3

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by