Uniform law (column vector).


Prototype

static Vecf randu(int n, float a=-1, float b=1)

Parameters

nNumber of points to generate.
aMinimal value.
bMaximal value.

Returns

A vector of random values, sampling according to a uniform law between a and b.

Description

Example

  // 100 valeurs aléatoires (loi uniforme entre 0 et 1)
  soit x = randu(1000);

  Figure f;
  f.plot(x, "go");

See also

randn(int), randi(), randb()