Question: Matlab The output should look like this: Enter the exponent k:3 ERROR: You entered incorrect k. Possible choices are: 2, 4, and 6 Enter the
Matlab

The output should look like this: Enter the exponent k:3 ERROR: You entered incorrect k. Possible choices are: 2, 4, and 6 Enter the exponent k:2 Sum for k = 2, exactsum = 1.6449, approxsum = 1.6448 for N = 6079, relerror = 0.010 Do you want another k: Yes (1) or No (0) 1 Enter the exponent k:4 Sum for k = 4, exactsum = 1.0823, approxsum = 1.0822 for N = 15, relerror = 0.008 Do you want another k: Yes (1) or No (0) 1 Enter the exponent k:6 Sum for k = 6, exactsum = 1.0173, approxsum = 1.0173 for N = 5, relerror = 0.004 Do you want another k: Yes (1) or No (0) 0
Problem 2: It is known that the exact values of the following three sums are 6 For each k, the objective of this problem is to determine N so that the approx imate value of the sum is such that the relative percentile error S-SN RE-100-m 0.01% In the main script input the value of k = 2, 4, or 6, Depending on the value of k, evaluate the exact sum S and call the function sumfun(k,S,N) which should return the approximate value of the sum, the relative error, and the value of N needed to meet the above percentile accuracjy If you input k that is not 2,4, or 6, the script should display an error message and ask you to input a correct value of k You should also use a while loop which allows you to input different values of k during one run of the code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
