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

4 vues (au cours des 30 derniers jours)
Kalpha.mc
Kalpha.mc le 12 Sep 2020
Commenté : Kalpha.mc le 12 Sep 2020
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.

Réponse acceptée

madhan ravi
madhan ravi le 12 Sep 2020
CombS = perms(1 : 3)
How_many = size(CombS, 1)

Plus de réponses (0)

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by