Here's an implementation of the function y=x(t,n)
that calculates the taylor series of e^t
up to n
terms in MATLAB:
main.m483 chars17 lines
To use this function, simply call it with a value of t
and the desired number of terms n
, like so:
main.m12 chars2 lines
This will calculate the value of the Taylor series of e^1
up to 5
terms. The result will be stored in the variable y
.
gistlibby LogSnag