I have a data set of monthly averages and would like to make a loop to get an average of every month, so the average of every January, February, and etc.
Here is my data:
1973 1 144.46 4.68
1973 2 118.77 5.05
1973 3 57.76 7.42
1973 4 103.44 6.01
1973 5 84.11 6.18
1973 6 74.74 6.11
1973 7 64.86 6.46
1973 8 69.95 6.07
1973 9 75.25 5.66
1973 10 91.90 5.64
I can do it the hard way:
a=find(vinddata_mean_monthly(:,2)==1);
jan=vinddata_mean_monthly(a,:);
jan_dir=mean(jan(:,3));
jan_spd=mean(jan(:,4));
..
But if anyone could help my make a loop, help would be greatly appreciated.
Kristine
Best Answer