combinations
Generate all combinations of categorical values.
📝Syntax
T = combinations(A1, A2, ...)
📥Input Arguments
Parameter Description
A1, A2, ... Input arrays. Each input is converted to a column before the combinations are formed.
📤Output Arguments
Parameter Description
T Table containing one row for each combination of input elements.
📄Description

combinations forms a table containing the Cartesian product of the supplied arrays.

When an input variable has a name, that name is reused as the corresponding table variable name.

💡Examples
Combine two categorical arrays.
A = categorical({'small','large'}); B = categorical({'red','blue'}); T = combinations(A, B)
🔗See Also
categoricaltableheightwidth
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub