Function File: b = randerr (n)
Function File: b = randerr (n, m)
Function File: b = randerr (n, m, err)
Function File: b = randerr (n, m, err, seed)

Generate a matrix of random bit errors. The size of the matrix is n rows by m columns. By default m is equal to n. Bit errors in the matrix are indicated by a 1.

The variable err determines the number of errors per row. By default the return matrix b has exactly one bit error per row. If err is a scalar, there each row of b has exactly this number of errors per row. If err is a vector then each row has a number of errors that is in this vector. Each number of errors has an equal probability. If err is a matrix with two rows, then the first row determines the number of errors and the second their probabilities.

The variable seed allows the random number generator to be seeded with a fixed value. The initial seed will be restored when returning.

Package: communications