I haven't run through this toolbox yet, so I apologize if I am missing something with this question (I just glanced through the source code because I am interested in directional stats).
When you calculate the mean, the formula you use is:
% compute weighted sum of cos and sin of angles
r = w'*exp(1i*alpha);
% obtain mean by
mu = angle(r);
Now, correct me if I'm wrong, but this doesn't seem to calculate the average at all? It seems to me that here we are inputting a data array into the angle command, which will output the phase angle of each element of that array, not a singular mean.
Wouldn't a better way of calculating the average be to use atan2? Something like:
for i = 1:w
S(i) = sin(alpha(i));
C(i) = cos(alpha(i));