8 lines
98 B
Matlab
8 lines
98 B
Matlab
function x = myfactorial(n)
|
|
% return the factorial of n
|
|
x = 1;
|
|
for i = 1:n
|
|
x = x * i;
|
|
end
|
|
end
|