function y = fact(n) % funzione che calcola il fattoriale di un numero n % uso: f=fact(n) f=1; for k=1:n f=f*k; end y=f; end