How can I construct all fairs of points?

조회 수: 2 (최근 30일)
Han
Han 2020년 6월 2일
답변: David Hill 2020년 6월 2일
For example, there are points and fairs of the points.
points = [(1:10); 100*rand(2,10)]';
fairs = [(1:17); floor(1:0.5:9); ceil(2:0.5:10)]';
But, the fairs are not all fairs of points. It shows only 17 random fairs.
How can I construct the fairs of the all points?
For example I want to construct the following fairs for three points.
1,2
1,3
2,3
2,1
3,1
3,2
  댓글 수: 2
madhan ravi
madhan ravi 2020년 6월 2일
Is that the expected output?
Han
Han 2020년 6월 2일
the expected output is
1,1,2
2,1,3
3,2,3
4,2,1
5,3,1
6,3,2
The first colume is index.
I want to find the all fair cases.

댓글을 달려면 로그인하십시오.

채택된 답변

David Hill
David Hill 2020년 6월 2일
a=nchoosek([1 2 3],2);
b=[a; fliplr(a)];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Math에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by