Problem 44737. Get the combinations
Consider p,q = 2 vectors of same or different length. Get a Output Array which has all the possible combinations of Elements of vectors p and q for example:
p = [1 2 3], q = [10 12]
then
Output = [1 10;2 10;3 10;1 12;2 12;3 12]
Solution Stats
Problem Comments
-
1 Comment
Dyuman Joshi
on 9 May 2021
Test cases are added.
Solution Comments
Show commentsProblem Recent Solvers40
Suggested Problems
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2106 Solvers
-
Project Euler: Problem 10, Sum of Primes
1691 Solvers
-
Sum of first n positive integers
575 Solvers
-
Test Problem; Create a 5x5 array containing all ones
379 Solvers
-
Find my daddy long leg (No 's')
2286 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!