How do I get all possible combinations?
2 views (last 30 days)
Show older comments
Hi, My data is such, I have 3 types of generators. Each type has several units and for each type the capacity of the units is same.
Type 1: 58 units, all of 60 MW capacity
Type 2: 5 units, all of 450 MW capacity
Type 3: 20 units, all of 600 MW capacity
This will give me (58+1) * (5+1) * (20+1) = 7434 generating scenarios.
My question is, what can I do to get all 7434 scenarios in decreasing order in a single row or column matrix?
0 Comments
Accepted Answer
Image Analyst
on 4 Nov 2014
I don't know why you're adding 1 but to get all combinations you can use meshgrid():
[type1, type2, type3] = meshgrid(1:58, 1:5, 1:20);
type1 = type1(:);
type2 = type2(:);
type3 = type3(:);
More Answers (0)
See Also
Categories
Find more on Matrices and Arrays 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!