Home How to get combinations of vectors?

# How to get combinations of vectors?

user1089
1#
user1089 Published in April 23, 2018, 8:51 pm
 This question already has an answer here: How to generate all pairs from two vectors in MATLAB using vectorised code? 7 answers Generate a matrix containing all combinations of elements taken from n vectors 4 answers I have two configurations, lets say 0 0 0 and 1 1 1. I would like to get all the intermediate combinations using Matlab: 0 0 0 1 0 0 0 1 0 0 0 1 1 1 0 1 0 1 0 1 1 1 1 1  Though it appears like a simple requirement, I was not able to automate this procedure. The array size is always 3. I can write the combinations manually, but I am looking for the logic (function) to achieve this.
 You need to login account before you can post.
Processed in 0.309079 second(s) , Gzip On .