Combinations of variables and step sizing for creation of DOE
显示 更早的评论
I'm using matlab to create .txt files containing variables for another program.
I'm trying to create a Design Of Experiments.
An example is, I have 3 variables,v1=5,v2=15 and v3=100
Now each variable also has a step size, v1s=1, v2s=5, v3s=10
and each variable steps by different amounts, so v1a=3,v2a=4,v3a=5
So now I have 3*4*5=60 possible different combinations.
so combination no: 1= 5,15,100 2= 6,15,100 3= 7,15,100 4= 5,20,100 5= 5,25,100 etc....
I'm trying to think of a way that can create all this on the fly for any amount of variables and step sizes but really coming unstuck here.
If anyone has some help it would be greatly appreciated.
Thanks.
采纳的回答
更多回答(2 个)
Tom Lane
2012-1-25
Do you have the Statistics Toolbox available? It seems like what you want is a full factorial design, but with the variable levels chosen from a set other than {1,2,...,k}. Here's an example creating a two-variable design with every combination of {10,20} for the first variable and {100,200,300} for the second.
>> s1 = [10 20];
>> s2 = [100 200 300];
>> x = fullfact([2 3])
x =
1 1
2 1
1 2
2 2
1 3
2 3
>> x(:,1) = s1(x(:,1));
>> x(:,2) = s2(x(:,2))
x =
10 100
20 100
10 200
20 200
10 300
20 300
This is similar to Walter's ndgrid idea, but for three variables it gives a three-column matrix instead of three separate MATLAB variables.
1 个评论
Noubara Djimadoumbaye
2012-2-2
Thanks Tom Lane. This answers to my question. Good night!
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!