MATLAB Answers

How to plot this on a graph

2 views (last 30 days)
DARREN O BRIEN
DARREN O BRIEN on 30 Oct 2020
Commented: Ameer Hamza on 31 Oct 2020 at 8:09
how do u plot this between 0 and 2
syms n x
F = symsum(1/factorial(n),n,1,5)

  0 Comments

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 30 Oct 2020
There is no 'x' in your expression inside symsum(). I guess you are tyring to plot taylor series of exp(x). Try this
syms n x
F = symsum(x^n/factorial(n),n,0,5);
fplot(F, [0 2])

  9 Comments

Show 6 older comments
Ameer Hamza
Ameer Hamza on 30 Oct 2020
But the original question had a reference to symsum() and x range from [0 2], so that was confusing. If you just want to plot 1/n! then you can do it like this
n = 1:5;
y = 1./factorial(n);
plot(n, y)
DARREN O BRIEN
DARREN O BRIEN on 30 Oct 2020
sorry for the confusion but in the question we are given its plot the corresponding polynomial over the range 0 ≤ x ≤ 2
Ameer Hamza
Ameer Hamza on 31 Oct 2020 at 8:09
But how do you define the polynomial from the series of 1/n!. If you look at my original answer. It does create a polynomial.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by