Question: and 2 2 is given by the formula: = | 2 2 - x N 2 2 | Note the vertical bars indicate an absolute
and is given by the formula:
Note the vertical bars indicate an absolute value. Write a function called sqrtapprox that takes some userspecified value of the relative error threshold as the single input and determines the numirer of terms required to converge to this error. Your Matlab function should:
Use a while loop to generate sequence terms until the relative error, is less than or equal to the userspecific error tolerance. Note that the userspecified error tolerance is the input to the function, not something to be defined within the function.
The first output of your function should be the value of the the last term generated.
The second output of your function should be the number of terms needed to meet the specified error tolerance.
Your function should also break the while loop if the number of terms needed to converge to the userspecified error tolerance exceeds this sequence converges really fast, hence the small upper limit on the number of terms When this happens, set both the first and second output of the function to
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
