How can i calculate mean wind direction(in degrees) from 1 minute to 10 minutes?
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 6 Mag 2020
Modificato: Walter Roberson
il 6 Mag 2020
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
il 6 Mag 2020
Risposta accettata
Più risposte (1)
Walter Roberson
il 6 Mag 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'
8 Commenti
Ana Soph
il 6 Mag 2020
Modificato: Walter Roberson
il 6 Mag 2020
Walter Roberson
il 6 Mag 2020
You can use https://www.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics circ_mean() but make sure to convert your angles to radians first.
Ana Soph
il 6 Mag 2020
Walter Roberson
il 6 Mag 2020
What error message do you get when you try to use the function?
Walter Roberson
il 6 Mag 2020
I just tried in R2015a and had no problem using the circ_mean function from that File Exchange Contribution.
Walter Roberson
il 7 Mag 2020
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
il 7 Mag 2020
Categorie
Scopri di più su Shifting and Sorting Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!