syms x
valuex=input('What is the value of x? ')
subs(taylor(exp(x),x, 'OrderMode','Relative','Order',valuex), valuex)
I need to modify my solution above so that, as well as computing and displaying the result of the Taylor series expansion, it also computes and displays the number of terms required for the approximation to be accurate to within 0.01.
The Taylor series for the exponential function e^x is 1 + (x^1)/1! + (x^2)/2! + (x^3)/3 ...

댓글 수: 2

Rik
Rik 2019년 1월 25일
This is probably easiest to solve by not using symbolic variables, but using an explicit loop instead.
Walter Roberson
Walter Roberson 2019년 1월 25일
? To confirm, the x that you evaluate the taylor series at, is to be the same as the Order (that is, the highest power to be used in the series) ??

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

태그

질문:

2019년 1월 25일

댓글:

2019년 1월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by