I would like to generate all the possible combinations
for example:
[1 2 3 4 5]
I want to generate a reordered version of the original:
[2 3 4 5 1;
3 4 5 1 2;
4 5 1 2 3;
5 1 2 3 4]
how should i do that?

답변 (1개)

Star Strider
Star Strider 2014년 8월 23일

1 개 추천

If you have the Statistics Toolbox, use the combnk function. Otherwise, use Matt Fig’s File Exchange contribution combinator.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

질문:

2014년 8월 23일

답변:

2014년 8월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by