randint.m
上传用户:loeagle
上传日期:2013-03-02
资源大小:1236k
文件大小:4k
源码类别:

通讯编程文档

开发平台:

Matlab

  1. function out = randint(varargin);
  2. %RANDINT Generate matrix of uniformly distributed random integers.
  3. %   OUT = RANDINT generates a "0" or "1" with equal probability.
  4. %
  5. %   OUT = RANDINT(M) generates an M-by-M matrix of random binary numbers.
  6. %   "0" and "1" occur with equal probability.
  7. %
  8. %   OUT = RANDINT(M,N) generates an M-by-N matrix of random binary numbers.
  9. %   "0" and "1" occur with equal probability.
  10. %
  11. %   OUT = RANDINT(M,N,RANGE) generates an M-by-N matrix of random integers.
  12. %
  13. %   RANGE can be either a scalar or a two-element vector:
  14. %   Scalar : If RANGE is a positive integer, then the output integer
  15. %            range is [0, RANGE-1].  If RANGE is a negative integer,
  16. %            then the output integer range is [RANGE+1, 0].
  17. %   Vector : If RANGE is a two-element vector, then the output
  18. %            integer range is [RANGE(1), RANGE(2)].
  19. %
  20. %   OUT = RANDINT(M,N,RANGE,STATE) resets the state of RAND to STATE.
  21. %
  22. %   Examples:
  23. %