How to count wind direction by year
1 view (last 30 days)
Show older comments
Hi.
I have daily data of wind direction from 1973 to 2013, and I want to make a loop that separates the data according to a certain wind direction (22.5-67.5 degrees) and then do a count every year. So that I will end up with a matrix with (2013-1973=) 40 values.
How can I do this in matlab?
Thanks in advance, Kristine
3 Comments
Accepted Answer
dpb
on 14 Jun 2014
Assuming you have (or can create) an array that has column containing year and another for direction (I'll use w for the wind column and y for year)...
a) segregate the direction data from the rest--
ix=iswithin(wdir,22.5,67.5);
b) count by year
n=hist(y(ix),[1973:2013]);
13 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!