how to find subsets

21 次查看(过去 30 天)
math search
math search 2014-6-2
Hi, if we have a set A={1,2,3,4,5,6} how can we find its subsets with four and five elements.

回答(2 个)

Mischa Kim
Mischa Kim 2014-6-2
编辑:Mischa Kim 2014-6-2
Hello, use nchoosek
A = [1,2,3,4,5,6];
subsA = nchoosek(A,4)
for four elements, for example.

math search
math search 2014-6-2
Thank you for the reply.

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by