home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / ELMAT.DI$ / LOGSPACE.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  501 b   |  20 lines

  1. function y = logspace(d1, d2, n)
  2. %LOGSPACE Logarithmically spaced vector.
  3. %    LOGSPACE(d1, d2) generates a row vector of 50 logarithmically
  4. %    equally spaced points between decades 10^d1 and 10^d2.  If d2
  5. %    is pi, then the points are between 10^d1 and pi.
  6. %
  7. %    LOGSPACE(d1, d2, N) generates N points.
  8. %
  9. %    See also LINSPACE, :.
  10.  
  11. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  12.  
  13. if nargin == 2
  14.     n = 50;
  15. end
  16. if d2 == pi
  17.     d2 = log10(pi);
  18. end
  19. y = (10).^ [d1+(0:n-2)*(d2-d1)/(n-1), d2];
  20.