Function Reference: fullfact

statistics: A = fullfact (N)

Full factorial design.

If N is a scalar, return the full factorial design with N binary choices, 0 and 1.

If N is a vector, return the full factorial design with ordinal choices 1 through n_i for each factor i.

Values in N must be positive integers.

@seealso {ff2n

Source Code: fullfact

Example: 1

 

 ## Full factorial design with 3 binary variables
 fullfact (3)

ans =

   0   0   0
   0   0   1
   0   1   0
   0   1   1
   1   0   0
   1   0   1
   1   1   0
   1   1   1

                    

Example: 2

 

 ## Full factorial design with 3 ordinal variables
 fullfact ([2, 3, 4])

ans =

   1   1   1
   1   1   2
   1   1   3
   1   1   4
   1   2   1
   1   2   2
   1   2   3
   1   2   4
   1   3   1
   1   3   2
   1   3   3
   1   3   4
   2   1   1
   2   1   2
   2   1   3
   2   1   4
   2   2   1
   2   2   2
   2   2   3
   2   2   4
   2   3   1
   2   3   2
   2   3   3
   2   3   4