How can I create a script that calculates this combinatorial?

6 Ansichten (letzte 30 Tage)
Carlos Siles Rivero
Carlos Siles Rivero am 23 Aug. 2020
Kommentiert: Vladimir Sovkov am 24 Aug. 2020

Antworten (1)

Vladimir Sovkov
Vladimir Sovkov am 23 Aug. 2020
C=nchoosek(n,r)
  2 Kommentare
Carlos Siles Rivero
Carlos Siles Rivero am 23 Aug. 2020
I managed to solve it with a "for", I hope I can help someone
Vladimir Sovkov
Vladimir Sovkov am 24 Aug. 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?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by