function fac = factorial(N);
% A function to compute the factorial of N.

if N == 0
    fac = 1;
else
    fac = 1;
    for i = 1:N
        fac = fac*i;
    end
end