You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spm_nCr.m
    path of file: ./repos/bspm/thirdparty/spm12
    
    the code of the file until where you have to start completion: function c = spm_nCr(n,r)
% Combinatorics: n choose r, nCr
% FORMAT c = spm_nCr(n,r)
%
% n - Number of objects
% r - Number of objects to choose
% c - n choose r
%__________________________________________________________________________
%
% spm_nCr returns the number of ways of choosing r objects from a pool
% of n objects, without replacement, order unimportant. Equivalently:
% the number of ways of putting r objects into n indistinguishable urns
% with exclusion. These are the Binomial coefficients of Pascal's
% triangle:
%            ( n )      n!
%            |   | = ---------
%            ( r )   r! (n-r)!
%
% n & r must be whole numbers, with n>=r. Non-integer or out-of-range
% arguments return zero as nCr. Non-scalar n & r must have the same

    
function c = spm_nCr(n,r)
% Combinatorics: n choose r, nCr
% FORMAT c = spm_nCr(n,r)
%
% n - Number of objects
% r - Number of objects to choose
% c - n choose r
%__________________________________________________________________________
%
% spm_nCr returns the number of ways of choosing r objects from a pool
% of n objects, without replacement, order unimportant. Equivalently:
% the number of ways of putting r objects into n indistinguishable urns
% with exclusion. These are the Binomial coefficients of Pascal's
% triangle:
%            ( n )      n!
%            |   | = ---------
%            ( r )   r! (n-r)!
%
% n & r must be whole numbers, with n>=r. Non-integer or out-of-range
% arguments return zero as nCr. Non-scalar n & r must have the same
% dimensons.
%
% Algorithm:
%--------------------------------------------------------------------------
% For vary small n, nCr can be computed naively as the ratio of
% factorials, using gamma(x+1) to return x!. For moderately sized n, n!
% (& r! &/or (n-r)!) become very large, and naive computation isn't
% possible. Direct computation is still possible upon noting that the
% expression cancels down to the product of r fractions:
%
%             n!       n   n-1         n-(r-1)
%         ---------  = - x --- x ... x -------
%         n! (n-r)!    r   r-1            1
%
% Unfortunately this cunning computation (given at the end