



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The process of designing and implementing a program to sum the maclaurin series for the exponential function exp(x) using matlab. The problem is stated, inputs and outputs are enumerated, and the algorithm is designed and refined. The document also includes a pseudo code representation of the program.
Typology: Study notes
1 / 7
This page cannot be seen from the preview
Don't miss anything!




✫ ✬
✪ ✩
Top Down Design
or
Structured Programming
State the Problem
output(s)Enumerate input(s) and
✫ ✬
✪ ✩
refined)Design the Algorithm (this is
Convert to
Matlab
Test code components
Assemble and test
✫ ✬
✪ ✩
The Maclaurin series for
exp(
x )
is exp(
x ) = 1 +
(^) x (^) +
x 2
x n
n !
(^)...
Let’s designate
term
0 = 1
term
x , and so on
Note that
term
term
k − 1 k x
When
term
k < tol
stop the sum
✫ ✬
✪ ✩
The
relative terror
is
rel
sum
(^) exp(
x ) |
exp(
x )
of terms and the relative errorPrint out the sum,the number
✫ ✬
✪ ✩
tol continue, if next term exceeds
compute relative error
print information to the screen