how do u plot this between 0 and 2
syms n x
F = symsum(1/factorial(n),n,1,5)

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 30일

0 개 추천

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

DARREN O BRIEN
DARREN O BRIEN 2020년 10월 30일
its a power series which is close to the taylor but still a little different but i was wrong its (n+1)(n+1)-(n-2)/n!
so if u can show how to plot that i would be gratefull
Ameer Hamza
Ameer Hamza 2020년 10월 30일
Where is 'x' in your series?
Ameer Hamza
Ameer Hamza 2020년 10월 30일
Can you show the mathematical form of your equations?
DARREN O BRIEN
DARREN O BRIEN 2020년 10월 30일
i was right the first time its 1/n! but the maths behind is in the picture its too long too write
If you just want to plot 1/n! then you will just get a straight line becuase there is no dependency on 'x'
syms n x
F = symsum(1/factorial(n),n,0,5);
fplot(F, [0 2])
DARREN O BRIEN
DARREN O BRIEN 2020년 10월 30일
if u put the numbers in 1, 1/2,1/6,1/24,1/120, 1/720. thats obviously not a straight line
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 2020년 10월 30일
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 2020년 10월 31일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2020년 10월 30일

댓글:

2020년 10월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by