Full factorial design
B = scidoe_fullfact(levels)
a n-by-1 or 1-by-n matrix of doubles, integer value, positive, the number of levels for each factor j, for j=1,2,...,n
a m-by-n matrix of doubles, the experiments, where m=prod(levels). For j=1,2,...,n and i=1,2,...,m, and the entry B(i,j) is the level of the experiment #i for the variable #j. For a given variable j=1,2,...,n, the entries B(:,j) are in the set {1,2,...,level(j)}.
Computes a full factorial design with prescribed number of levels for each factor. In other words, for each factor j, the number of levels is levels(j), for j=1,2,...,n.
// Create a full factorial design with : // 2 levels for the first factor // 3 levels for the second factor levels=[2 3] B=scidoe_fullfact(levels) // Scale this design into [0,1] m=size(B,"r") C = (B-1)./(levels(ones(m,1),:)-1) // Scale this design into [-1,1] D=2*C-1 // Plot this design scf(); scidoe_plotcube(2); plot(D(:,1),D(:,2),"bo"); xtitle("Full Factorial Design","X1","X2") // Create a full factorial design with : // 2 levels for the first factor // 3 levels for the second factor // 4 levels for the third factor levels = [2 3 4] B=scidoe_fullfact(levels) // Scale this design into [0,1] m=size(B,"r") C = (B-1)./(levels(ones(m,1),:)-1) // Scale this design into [-1,1] D=2*C-1 // Plot this design h = scf(); param3d(D(:,1),D(:,2),D(:,3)) h.children.children.mark_mode="on"; h.children.children.line_mode="off"; h.children.children.mark_size=1; scidoe_plotcube(3) xtitle("Full Factorial Design","X1","X2","X3") // Print the number of experiments // Use 3 levels for each parameter for n = 1 : 10 levels = 3*ones(n,1); B=scidoe_fullfact(levels); m = size(B,"r"); mprintf("n=%d, Num. Experiments=%d\n",.. n,m) end | ![]() | ![]() |