algorithm to select each elements (number)

1)I want an algorithm which will have this table A=[1 2 3 4 5]
2) to select each elements (number) for each line only once and when it goes to the next have the opportunity to once again select the same number with a different
3) each time selected three elements will calculate all the combinations that can make and my displays them every time and what their combinations
4) I would like to run the algorithm before the upload will I wanted to be written for older versions of matlab
Each , after go to the next line
B.C
1 3 4,
2 4 5,
3 5 1,
2 3 4,
1 4 5,
2 5 3,
1 5 4,
,,,,,,
,,,,,,,
combinations are above other I put some

댓글 수: 2

Geoff Hayes
Geoff Hayes 2017년 1월 3일
You may want to clarify some of your steps. What do you mean ...have the opportunity to once again select the same number with a different? Different what?
Please provide a small example with output from each step of your algorithm.
dhmhtrhs
dhmhtrhs 2017년 1월 4일
편집: Geoff Hayes 2017년 1월 4일
Each , after go to the next line
B.C
1 3 4,
2 4 5,
3 5 1,
2 3 4,
1 4 5,
2 5 3,
1 5 4, ,,,,,, ,,,,,,,
is 7 combinations , are above other I put some

답변 (1개)

Guillaume
Guillaume 2017년 1월 4일

0 개 추천

Your question is very unclear. Most of your sentences are hard to understand, I'm afraid.
From your example, it would appear you want:
B = nchoosek(A, 3)

댓글 수: 2

dhmhtrhs
dhmhtrhs 2017년 1월 4일
Show me similar command if it is unique then I do if there are similar command would like to wish to write the
I don't understand either (that makes 3 of us). Perhaps you can get another English speaker to review your question, then edit it to update it with a better explanation.

이 질문은 마감되었습니다.

질문:

2017년 1월 3일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by