enumerate all possible combinations of an input space
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
for example I have 3 categorical variable, X1 can be 'A,B,or C', X2 can be 'A or D', X3 can be 'E or F', so there can be 3X2X2 different possible combinations:
AAE,AAF, ADE,ADF,BAE,BAF,BDE,BDF,CAE,CAF,CDE,CDF.
which function sould I use to create such a complete list?
0 Kommentare
Antworten (1)
Walter Roberson
am 14 Mär. 2021
X1 = categorical({'A', 'B', 'C'})
X2 = categorical({'A', 'D'})
X3 = categorical({'E', 'F'})
[X1g, X2g, X3g] = ndgrid(X1, X2, X3);
output = [X1g(:), X2g(:), X3g(:)]
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!