How to generate all possible combinations of K instances of N objects in Matlab?
For example, if we have N=3 objects A, B and C, and wish to generate combinations of K=2 instances, we should get
AA
AB
AC
BA
BB
BC
CA
CB
CC
I.e. this is how figures in a number combinate.