How can I create a script that calculates this combinatorial?

1 回表示 (過去 30 日間)
Carlos Siles Rivero
Carlos Siles Rivero 2020 年 8 月 23 日
コメント済み: Vladimir Sovkov 2020 年 8 月 24 日

回答 (1 件)

Vladimir Sovkov
Vladimir Sovkov 2020 年 8 月 23 日
C=nchoosek(n,r)
  2 件のコメント
Carlos Siles Rivero
Carlos Siles Rivero 2020 年 8 月 23 日
I managed to solve it with a "for", I hope I can help someone
Vladimir Sovkov
Vladimir Sovkov 2020 年 8 月 24 日
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?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by