MATLAB Answers

Taylor series approximation problem

조회 수: 12(최근 30일)
Lingbai Ren
Lingbai Ren 2021년 9월 15일
댓글: Lingbai Ren 2021년 9월 24일 20:02
we are considering a Taylor series approximation of f(x) = e^(-x)
my questions is how to compute the Taylor Series approximation of f(x).
The requirements are: the code should take as input x_i, x_i+1, and the order, n.
The code should output the normalized true error e_T, at x_i+1
I'm totally lost where to start, hope to get some hints or help!

채택된 답변

Matt J
Matt J 2021년 9월 15일
As an example,
syms x
T = 
fn = function_handle with value:
ans = 0.0216
You can of course find more examples in the documentation for taylor() and matlabuUnction()
  댓글 수: 1
Lingbai Ren
Lingbai Ren 2021년 9월 24일 20:02
Sorry Matt for the late reply, I think what works, but I finally wrote a whole for loop to run that! Thanks for helping!

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

추가 답변(0개)




Community Treasure Hunt

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

Start Hunting!

Translated by