How can I create a script that calculates this combinatorial?
1 view (last 30 days)
Show older comments
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350213/image.jpeg)
0 Comments
Answers (1)
Vladimir Sovkov
on 23 Aug 2020
C=nchoosek(n,r)
2 Comments
Vladimir Sovkov
on 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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350570/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350573/image.png)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!