Main Content

fullfact

Full factorial design

Description

dFF = fullfact(levels) returns a numeric matrix dFF containing the treatments of a full factorial design specified by levels. The elements of the input vector levels correspond to the number of levels for each individual factor. Each row of dFF corresponds to a single treatment (combination of the factor levels). Each column of dFF contains the treatment values for a single factor, with integer values ranging from one to the number of levels. The size of dFF is m-by-n, where m is the product of the elements of levels, and n is the length of levels.

example

Examples

collapse all

Create a full factorial design for two factors that has two levels in the first factor and four levels in the second factor.

dFF = fullfact([2 4])
dFF = 8×2

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

Each row of dff corresponds to a single treatment (combination of factor levels) in the full factorial design.

Input Arguments

collapse all

Number of levels for each factor in the full factorial design, specified as a vector of positive integers.

Example: [3 5]

Data Types: single | double

Tips

  • To create a full factorial design where each factor has only two levels (0 and 1), use ff2n.

Alternative Functionality

Instead of using fullfact, you can create a fullFactorialDOE object by using the fullFactorialDOE function. The fullFactorialDOE function provides these advantages:

  • The fullFactorialDOE function allows you to specify the factor names, number of factors, which factors are categorical, number and values of the levels for each factor, and experiment model.

  • In addition to returning the design points, the fullFactorialDOE function stores your specifications in the fullFactorialDOE object properties.

  • After you create a fullFactorialDOE object, you can fit a linear model to the design points using the fitlm function.

Version History

Introduced before R2006a