Effacer les filtres
Effacer les filtres

How can I generate matrix with one loop?

1 vue (au cours des 30 derniers jours)
Hind Thanoon
Hind Thanoon le 21 Avr 2020
Commenté : Hind Thanoon le 21 Avr 2020
Hello, I need to generate this matrix without many loops:
[1 2 3; 1 2 4; 1 2 5; 1 2 6; 1 3 4; 1 3 5; 1 3 6; 1 4 5; 1 4 6; 1 5 6; 2 3 4; 2 3 5; 2 3 6; 2 4 5; 2 4 6; 2 5 6; 3 4 5;
3 4 6; 3 5 6; 4 5 6];
I need simple way that can generate this matrix without many for loops

Réponse acceptée

Geoff Hayes
Geoff Hayes le 21 Avr 2020
Hind - try using nchoosek.
  1 commentaire
Hind Thanoon
Hind Thanoon le 21 Avr 2020
Thank you very much. Its work.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by