Returns the next element of the Halton sequence.
next = lowdisc_haltonnext ( dimension , index , primemat )
a 1 x 1 matrix of floating point integers, the number of variables
a 1 x 1 matrix of floating point integers, the index of the element in the sequence
a 1 x 1 matrix of floating point integers, a matrix of consecutive primes, in increasing order
a 1 x 1 matrix of doubles, the next element in the sequence, in the [0,1) interval
Generates the next element of the Halton sequence.
// See the source code edit lowdisc_haltonnext // Get a matrix of 100 primes primemat = lowdisc_primes100 ( ); dimension = 2; // Generate element #0 of the Halton sequence in dimension 2 next = lowdisc_haltonnext ( dimension , 0 , primemat ) // Generate element #1 of the Halton sequence in dimension 2 next = lowdisc_haltonnext ( dimension , 1 , primemat ) // Generate element #2 of the Halton sequence in dimension 2 next = lowdisc_haltonnext ( dimension , 2 , primemat ) // Generate some elements for i = 0 : 2^7-1 next(i+1,1:dimension) = lowdisc_haltonnext ( dimension , i , primemat ); end // Plot them plot ( next(:,1) , next(:,2) , "bo" )
"Algorithm 247: Radical-Inverse Quasi-Random Point Sequence", J H Halton and G B Smith, Communications of the ACM, Volume 7, 1964, pages 701-702.