Filter löschen
Filter löschen

In "nchoosek" function, how to do some of elements of matrix are the same?

1 Ansicht (letzte 30 Tage)
Brian Kim
Brian Kim am 19 Sep. 2017
Beantwortet: Andrei Bobrov am 19 Sep. 2017
the title just is question.
I want to get including that
  2 Kommentare
KSSV
KSSV am 19 Sep. 2017
nchoosek picks the elements if they are same also...
Brian Kim
Brian Kim am 19 Sep. 2017
i don't know whats mean. as if A=[6 6 7 7 9 11 13]. same things are 6 and 7.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Andrei Bobrov
Andrei Bobrov am 19 Sep. 2017
>> nchoosek(A,2)
ans =
6 6
6 7
6 7
6 9
6 11
6 13
6 7
6 7
6 9
6 11
6 13
7 7
7 9
7 11
7 13
7 9
7 11
7 13
9 11
9 13
11 13
>> nchoosek(unique(A),2)
ans =
6 7
6 9
6 11
6 13
7 9
7 11
7 13
9 11
9 13
11 13
>>

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!