Is there a function to evaulate factorial(m)/factorial(n) in matlab where m and n is very large but the difference is finite
Show older comments
Is there a function to evaulate factorial(m)/factorial(n) in matlab where m and n is very large but the difference is finite
Answers (2)
Azzi Abdelmalek
on 8 Mar 2013
Edited: Azzi Abdelmalek
on 8 Mar 2013
%If m>n
result=prod(m+1:n)
%Else
result=1/(prod(n+1:m)
% factorial(n) is the same as prod(1:n)
1 Comment
Azzi Abdelmalek
on 9 Mar 2013
Edited: Azzi Abdelmalek
on 9 Mar 2013
Did this answer help?
Z F
on 9 Mar 2013
0 votes
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!