Random binary vector.

Namespace: dsp

Prototype

static Vecb randb(int n)

Parameters

nNumber of points to generate.

Returns

A vector of random values, 0 or 1.

Description

This function can be used to generate a random bit sequence.

Example

  // 100 tirages à pile ou face (0 ou 1)
  soit x = randb(100);

  Figure f;
  f.plot(x, "|bo");

See also

randn(int), randu(int,float,float), randi()