Binomial coefficients in matlab

Alec Jacobson

December 03, 2012

weblog/

Here's a line to produce binomial coefficients in matlab:
% deg is the row in pascal's triangle
bsxfun(@rdivide,factorial(deg),factorial(0:deg).*factorial(deg:-1:0))