linspacecircular.m 385 B

12345678910111213141516
  1. function f = linspacecircular(x1,x2,n)
  2. % function f = linspacecircular(x1,x2,n)
  3. %
  4. % <x1>,<x2> are numbers
  5. % <n> is the number of desired points
  6. %
  7. % return a vector of equally spaced values starting at <x1>
  8. % and stopping just before <x2> (<x2> is treated as equivalent
  9. % to <x1>).
  10. %
  11. % example:
  12. % isequal(linspacecircular(0,8,4),[0 2 4 6])
  13. dif = (x2-x1)/n;
  14. f = linspace(x1,x2-dif,n);