How do you bring about all possible combinations from two row vectors?
Show older comments
Say for example I have
x=[1 2 3 4] y=[1 2 3 4]
and I wanted to create a new vector z which would give all combinations of the elements of x and y. It would look something like
z=[(1,1) (1,2) (1,3) (1,4) (2,1) (2,2) (2,3) (2,4) (3,1) etc etc]. Is this even possible?
Accepted Answer
More Answers (0)
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!