How can I create a script that calculates this combinatorial?

回答(1 个)

C=nchoosek(n,r)

2 个评论

I managed to solve it with a "for", I hope I can help someone
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?

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by