function fact=fact(n) % This function calculates n! % Currently calculates 15!, change the value below for other integers. n=15; fact=1; for i=1: n fact = fact*i; end