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 CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by