randint2

PURPOSE ^

Faster but restricted version of randint.

SYNOPSIS ^

function R = randint2( m, n, range )

DESCRIPTION ^

 Faster but restricted version of randint.

 Generate matrix of uniformly distributed random integers.
 R=randint2(m,n,range) generates an m-by-n matrix of random integers
 between [range(1), range(2)]. Note that randint is part of the
 'Communications Toolbox' and may not be available on all systems.

 To test speed:
  tic, for i=1:1000; R = randint( 100, 10, [0 10] ); end; toc
  tic, for i=1:1000; R = randint2( 100, 10, [0 10] ); end; toc

 USAGE
  R = randint2( m, n, range )

 INPUTS
  m      - m rows
  n      - n cols
  range  - range of ints

 OUTPUTS
  R    - mxn matrix of integers

 EXAMPLE
  R = randint2( 2, 5, [0 1] )

 See also RANDINT

 Piotr's Computer Vision Matlab Toolbox      Version 2.12
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]

Generated by m2html © 2003