Definition type construction of Reed Muller code, of order R, length 2^M. This function returns the generator matrix for the said order RM code.
RM(r,m) codes are characterized by codewords,
sum ( (m,0) + (m,1) + ... + (m,r). Each of the codeword is got through spanning the space, using the finite set of m-basis codewords. Each codeword is 2^M elements long. see: Lin & Costello, "Error Control Coding", 2nd Ed.
Faster code constructions (also easier) exist, but since finding permutation order of the basis vectors, is important, we stick with the standard definitions. To use decoder function reedmullerdec, you need to use this specific generator function.G=reedmullergen(2,4);