MATLAB: Design of Experiments and Replication question

design of experimentsdox

How can I perform a full factorial analysis of the simulation using 5 replications with the following three inputs (a, b, and c) to the function that have a range of valid values:
Variable Minimum (A-) Maximum(A-)
a 0.01 0.1
b 1 5
c 1 3
I have the following code but I'm having trouble creating a loop and output matrix.
n = 3;
DM = ff2n(n);
DM ( DM == 0 ) = -1;
a = .01 : .1;
b = 1 : 5;
c = 1 : 3;
Xa = ((0.01 + 0.1)/2) + ((0.1 - 0.01)/2) * a;
Xb = ((1 + 5)/2) + ((5 - 1)/2) * b;
Xc = ((1 + 3)/2) + ((3 - 1)/2) * c;
Xa = ((-a + a)/2) + ((-a - a)/2) * a;
>> A = DM(:,1);
>> B = DM(:,2);
>> C = DM(:,3);

Best Answer

As far as I understand. You need to do something like this.
DM = combvec([-1 1], [-1 1], [-1 1]).'; % First create the matrix with -1 and 1 values
a = DM(:,1); % Then extract columns as a, b, and c
b = DM(:,2);
c = DM(:,3);
xa = 1/2+3/2*a;
xb = 1+2*b;
xc = 1/2*c;
xa, xb, and xc are 8x1 vectors. Then you need to run the simulation M times for the 8 combination of xa, xb, anc xc
M = 10; % run the simulation for M times
y = zeros(numel(x), M);
for i=1:numel(x)
for j=1:M
y(i,j) = run_simulation(xa(i), xb(i), xc(i)); % run_simulation is you function to simulate
% the parameters xa(i), xb(i), xc(i)
end
end