Group wind data in clusters based on direction

6 visualizzazioni (ultimi 30 giorni)
I have an annual table with wind direction values and I want to group them per month in 16 sectors based on the degrees.
Is it possible to do it automatically either than manually?
  5 Commenti
Ancalagon8
Ancalagon8 il 9 Gen 2023
@Adam Danz, @Walter Roberson thank you for your detailed and well-explained answers.

Accedi per commentare.

Risposta accettata

Star Strider
Star Strider il 8 Gen 2023
Modificato: Star Strider il 8 Gen 2023
One way to do this would be to use the histcounts function and get the first three outputs —
WindDir = rand(100,1)*360;
edgev = linspace(0, 360, 9);
[N,Edges,Octant] = histcounts(WindDir, edgev);
WindOctants = table(WindDir,Octant)
WindOctants = 100×2 table
WindDir Octant _______ ______ 123.39 3 272.97 7 352.43 8 10.679 1 199.56 5 205.31 5 258.28 6 329.39 8 146.07 4 171.63 4 333.69 8 328.55 8 85.531 2 331.01 8 92.321 3 232.95 6
The first output are the number of counts in each octant (bonus information), and the third is the respective octant.
EDIT — (8 Jan 2023 at 16:30)
Added table.
.
  20 Commenti

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Geographic Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by