Documentation of fact


Global Index (short | long) | Local contents | Local Index (short | long)


Function Synopsis

fac = fact(in);

Help text


  fac = fact(num);

  This is the same as num! .

  e.g., fact(5) = 5*4*3*2*1 etc.


Cross-Reference Information

This function is called by

Listing of function fact

function fac = fact(in);
if in == 0;
  fac = 1;
else
  fac = prod([1:in]);
end