How to create all possible outcome of a set amount of variables?

조회 수: 4 (최근 30일)
Kalpha.mc
Kalpha.mc 2020년 9월 12일
댓글: Kalpha.mc 2020년 9월 12일
So i have 3 numbers from 1-3. How would i create a matrix of all the possible outcome without repeating the number in each matrix.
such as
[1,2,3]
[3,2,1]
[2,1,3,]
[3,1,2]
......etc
Then display how many different combination there was.
The example i provided there are 4 rows total.

채택된 답변

madhan ravi
madhan ravi 2020년 9월 12일
CombS = perms(1 : 3)
How_many = size(CombS, 1)

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by