Question: Write a MATLAB program to estimate the sum of the in nite series:f ( N ) = PN n = 1 1 n 4 (
Write a MATLAB program to estimate the sum of the innite series:f N PN
n
n
a Use N ; The exact value of f N as N Compute the sum two ways.
First sum from to N: Then repeat the calculation but in reverse order that is from N to
in increments of Find the true relative error for each case. Note: be sure to view your
results in format long.
b Do the same exercise as above but using single precision. You can convert MATLAB variables
to single precision as shown in the following example:
sum ;
sum singlesum;
This creates a singleprecision variable, sum which has the same value as the doubleprecision
variable, sum, except that it is stored in bits rather than in bits. Operations done on
sum will automatically be carried out in single precision, and results of those calculations will
be stored in bit format. So the trick is that you need to declare your variables as single
precision BEFORE you begin your calculations.
c Comment on your results, and see if you can explain them
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
