Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 ( 5 0 marks ) : For the following Maclaurin series: c o s x = n = 0 ( - 1 )
Question marks:
For the following Maclaurin series:
cdots
i Write a MATLAB function, named myfun, that will accept and as inputs and produce one output, corresponding to the approximated value of given in the equation above. You must use forloops.
ii Test your function for and and store the result in a variable named testfun.
iii. For call the fun function six times, corresponding to and Use a forloop to solve this part and store the result of the function calls in an array named test fun.
iv Plot a bar graph showing the absolute error difference between the results for all calls and the actual value of Add a descriptive title and labels.
v Compare your performance for both functions using Call each function times and time them using the commands tic and toe.
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