How can I create a script that calculates this combinatorial?

1 vue (au cours des 30 derniers jours)
Carlos Siles Rivero
Carlos Siles Rivero le 23 Août 2020
Commenté : Vladimir Sovkov le 24 Août 2020

Réponses (1)

Vladimir Sovkov
Vladimir Sovkov le 23 Août 2020
C=nchoosek(n,r)
  2 commentaires
Carlos Siles Rivero
Carlos Siles Rivero le 23 Août 2020
I managed to solve it with a "for", I hope I can help someone
Vladimir Sovkov
Vladimir Sovkov le 24 Août 2020
Here you compute but not the binomial coefficient . Is this what you really want? Otherwise, what stops you from using the inbuilt function nchoosek, which is much more efficient than any loop construction can be?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming 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