How to evaluate large factorials

14 views (last 30 days)
Eric
Eric on 2 Sep 2014
Commented: madhan ravi on 13 Oct 2018
In Mathematica I could easily evaluate factorials, including large ones like 1000!
But in Matlab I can only evaluate up to 170!, because any number beyond that is greater than realmax, so the program gives me back infinity.
In another topic a user suggested that I should use the symbolic toolbox in this case.
My question is, how I do that? Is there any alternative way?

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 2 Sep 2014
syms n
subs(n*factorial(n-1),1000)
  2 Comments
Pramit Biswas
Pramit Biswas on 18 Feb 2018
Getting the following in between numbers:
\\\r\n
Walter Roberson
Walter Roberson on 18 Feb 2018
You can char() the result and delete those \ and r and n characters.
The characters are caused by a bug in the Symbolic Toolbox in your release.

Sign in to comment.

More Answers (1)

hend noda
hend noda on 13 Oct 2018
if
how this limit get??
  1 Comment
madhan ravi
madhan ravi on 13 Oct 2018
Post a new question because it’s completed different from the original question.

Sign in to comment.

Categories

Find more on Argument Definitions 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!