n = 0;
f = 1;
for i = 1:n
f = f*i;
you can get 0!=1 for n=0; Theoratical proof: he rigorous answer to this question is that the factorial operation is extended to non-integer arguments by what is called the Gamma function, defined as
Γ(x)=∫z^(x−1)*e^−z dz.limits 0 to infinity.
A bit of integration by parts can get you to the relation that for n∈N (natural numbers, where the factorial operation is naturally defined)