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

  1. %RAND    Uniformly distributed random numbers and matrices.
  2. %    RAND(N) is an N-by-N matrix with random entries, ordinarily
  3. %    chosen from a uniform distribution on the interval (0.0,1.0).
  4. %    RAND(M,N) or RAND([M,N]) is an M-by-N matrix with random entries.
  5. %    RAND(SIZE(A)) is the same size as A.
  6. %    RAND with no arguments is a scalar whose value changes each time
  7. %    it is referenced.
  8. %
  9. %    RAND('seed') returns the current seed of the uniform generator.
  10. %    RAND('seed',s) sets the uniform generator seed to s.
  11. %    RAND('seed',0) resets the seed its startup value.
  12. %    RAND('seed',sum(100*clock)) sets it to a different value each time.
  13. %
  14. %    By default, RAND samples a uniform distribution.  The function
  15. %    RANDN generates normally distributed random matrices.
  16. %    RAND and RANDN have separate generators, each with its own seed.
  17. %
  18. %    Previous versions of MATLAB allowed RAND('normal') to switch
  19. %    the prevailing distribution to normal, RAND('uniform') to switch
  20. %    back to uniform distribution, and RAND('dist') to return a string
  21. %    containing the prevailing distribution, either 'uniform' or 'normal'.
  22. %    MATLAB Version 4.0 continues to allow this switch, but
  23. %    issues a warning message discouraging its use.
  24. %
  25. %    See also RANDN, SPRANDN.
  26.  
  27. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  28. %    Built-in function.
  29.