clear all; a = 1:10; fact = cumprod(a); f = fopen("factorial.txt", "w"); fprintf(f, "%g\n", fact); fclose(f);