function f = fact(n)

% f = fact(n)
%       calculates the factorial of n

f = 1;
for i=1:n
    f = f*i;
end
