Let 6 ( x ) = ²/2 ( x + ²/2 ) Write a MATLAB function e = squareroot (x, n) that computes the errors X ek := xk for k= 0
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Let 6 ( x ) = ²/2 ( x + ²/2 ) Write a MATLAB function e = squareroot (x, n) that computes the errors X ek := xk for k= 0
Let 6 ( x ) = ²/2 ( x + ²/2 ) Write a MATLAB function e = squareroot (x, n) that computes the errors X ek := xk for k= 0,1,2,. . . ‚n Determine the order of the method. (Use format short e.) Hint: In e = squareroot (x, n) x is the initial guess and n is the number iterations. The output should be an detectrate (e) has been provided for rate detection. Notice, that there are many different ways to estimate the rate. Sample code for rate detection is provided as follows: array of size n+1 . A routine rate = function rate = detectrate(error) %DETECTRATE Summary of this function goes here % Detailed explanation goes here error = abs(error); I = find(error); error = log(error(I)); poly = polyfit(error(1:end-1),error(2:end), 1); rate = poly(1); end
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!