Answered step by step
Verified Expert Solution
Question
1 Approved Answer
wnloads/HW5 pdf Create a MATLAB code to calculate function f (z) = ei8r at any given point using Taylor series. Write a script file called
wnloads/HW5 pdf Create a MATLAB code to calculate function f (z) = ei8r at any given point using Taylor series. Write a script file called myTaylor.m and a function file called myFact.m to do the following: (a) The function myFact.m should return the factorial of a number when sent the number. In the script file: i. Set the starting point as r0-1 and fo = f(d)-6.049647 ii. Ask the user to enter his/her desired point and store it in x1 iii. Calculate the true solution for f(r1) and store it in TrueF1 iv. Calculate the first term of Taylor series at x1 and store it in TaylorF1 v. Calculate the true relative error of TaylorF1 and store it in TrueError vi. Use while loop and calculate next terms of Taylor formulation until the true relative error is less than 2%. (b) Once the next term is calculated, it should be added to the current value of TaylorF1 and the TrueError should be updated. i. Print the values of TaylorF1 and TrueError after each calculation ii. Count the number of Taylor formulation terms and print them (c) Run your program twice i. For x1 1.13 (you tan compare the results of this case with Question 2 ii. For one other x1 value of your choice. -IMG 6938JPG AIMG 6937 PG 4 5 6 8
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