How to create the combination (CN, k)of zeros and ones matrix in matlab?

Greetings dear friends
I would like to ask you about how I could create an 11x11 square matrix of zeros and ones, taking into account that I want to combine C11,6 (6 objects taken among 11 objects), which results in 462 using the formula, then I applied the following code, but it did not I get a square matrix, thanks for your help

3 Kommentare

Voss
Voss am 22 Nov. 2022
Bearbeitet: Voss am 22 Nov. 2022
I'm confused about what 11x11 matrix you want to end up with. Can you explain? Or perhaps show a smaller example, including the desired output matrix? For example, if N = 3 and k = 2, what would the result be and why?
Thanks for your answer dear friend, what I need to get is an array similar to this:
Taking into account that the number of combinations when N=11 and k=6 is 462
It is still not clear what you need for output.
Trying to ask the same question that @Voss did ...
Suppose that instead of N=11, k=6 (which has 426 combinations), you use the smaller example of N=3, k=2 (which has just 6 combinations). What should the output be? Don't tell us what the output should be similar to. Tell us exactly what the output should be for this small case. (The array you show above is just the identity matrix, so it is very unclear what you mean.)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 22 Nov. 2022

Kommentiert:

am 22 Nov. 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by