fixed factorial exercises

This commit is contained in:
Jan Benda 2017-01-19 12:09:00 +01:00
parent 9fbf7653b1
commit bd055b12e5
3 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
printfaculty(5); printfactorial(5);

View File

@ -1,4 +1,4 @@
function x = mufactorial(n) function x = myfactorial(n)
% return the factorial of n % return the factorial of n
x = 1; x = 1;
for i = 1:n for i = 1:n

View File

@ -1,5 +1,5 @@
function printfaculty(n) function printfactorial(n)
% compute the faculty of n and print it % compute the factorial of n and print it
x = 1; x = 1;
for i = 1:n for i = 1:n
x = x * i; x = x * i;