Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions: 1 . Create using MATLAB 2 . Use the following program: C l C clear Approximate the value of e ? ? x using
Instructions:
Create using MATLAB
Use the following program:
clear
Approximate the value of using the Taylor Series
input 'Enter the value of for ;
input Enter the amount of desired terms. ;
;
etaylor ; initializing the variable for the accumulator
while
etaylor etaylor factorial ;
; change the value of variable
end
realvalue exp;
dispReal Value'
disprealvalue
dispApproximated value with Taylor series'
disp etaylor
dispamount of iterations'
disp
dispreal error'
abs etaylor realvalue;
disp
Modify the program to do:
a The program calculates the actual value with the Matlab expx command.
b Change the while cycle for a forloop command from to imax iteration.
c Declare an imax variable equal to to assign the maximum iteration.
d Add before the for loop a line with: real exp x;
e Assign the value of to a tolerance variable. If you want to challenge yourself, create a menu to select the tolerance value with different values.
f Add within the loop algorithm and if abs etaylor real tolerance, then break.
Create the flowchart of the program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started