circ_axial.m 521 B

1234567891011121314151617181920212223242526272829
  1. function alpha = circ_axial(alpha, p)
  2. %
  3. % alpha = circ_axial(alpha, p)
  4. % Transforms p-axial data to a common scale.
  5. %
  6. % Input:
  7. % alpha sample of angles in radians
  8. % [p number of modes]
  9. %
  10. % Output:
  11. % alpha transformed data
  12. %
  13. % PHB 2009
  14. %
  15. % References:
  16. % Statistical analysis of circular data, N. I. Fisher
  17. %
  18. % Circular Statistics Toolbox for Matlab
  19. % By Philipp Berens, 2009
  20. % berens@tuebingen.mpg.de - www.kyb.mpg.de/~berens/circStat.html
  21. if nargin < 2
  22. p = 1;
  23. end
  24. alpha = mod(alpha*p,2*pi);