from Factorial of Large Numbers (>170) by Nabin S Sharma
Use of Symbolic Math Toolbox to calculate the factorial of large numbers.

fact(n)
function num = fact(n)
%function num = fact(n)
%n: input number whose factorial is required
%num: factorial of n
%
% This function symbolic math toolbox to evaluate the factorial of a number
% that is greater than 170. Other file example.m demonstrates the
% usefullness of this function.
%
%Nabin S. Sharma
%UMass Dartmouth
%Date:October 25, 2008

kfac = sym('k!');
syms k;
num = subs(kfac,k,n);

Contact us at files@mathworks.com