Question
Do a modification of exercise 11.1 on page 260 of chapter 11. Create a simple function m-file, named fx2.m that accepts a vector input and
Do a modification of exercise 11.1 on page 260 of chapter 11. Create a simple function m-file, named fx2.m that accepts a vector input and outputs a vector whose elements are the element-wise squares of the input vector elements. Then create a driver m-file named ex11p1_LastName.m that calls fx2.m in order to perform the Newton quotient. Compute the error in the estimated derivative for h values: 10^(0), 10^(-1), 10^(-2) 10^(-16). Use the MATLAB function semilogx to plot the error versus h. NOTE: You should implement ex11p1_LastName.m without using a FOR loop (i.e., make use of MATLABs vectorization capability).
11.1 The Newton quotient: may be used to estimate the first derivative f (x) of a function f(x), if h is "small." Write a program to compute the Newton quotient for the function: f(x) -x at the point x 2 (the exact answer is 4) for values of h starting at 1, and decreasing by a factor of 10 each time (use a for loop). The effect of rounding error becomes apparent when h gets "too small," i.e., less than about 10 12 11.1 The Newton quotient: may be used to estimate the first derivative f (x) of a function f(x), if h is "small." Write a program to compute the Newton quotient for the function: f(x) -x at the point x 2 (the exact answer is 4) for values of h starting at 1, and decreasing by a factor of 10 each time (use a for loop). The effect of rounding error becomes apparent when h gets "too small," i.e., less than about 10 12Step 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