Question: PROBLEM 2. WHILE LOOP Write a matlab script using a while loop structure to compute the natural log (2) using the harmonic series: Ln(2)= 1

PROBLEM 2. WHILE LOOP Write a matlab script using a while loop structure to compute the natural log (2) using the harmonic series: Ln(2)= 1 -1/2+ 1/3 1/4 + 1/5 - 1/6+ - (-1)^k/k + Notice that each term equals -(-1)^k/k, where k increases by 1 with each successive term (in other words, k =1 for the first term, k=2 for the second term, etc.). Keep adding successive terms until the series value changes by less than 0.001 (in other words when absolute value of -(-1)^k/k is less than 0.001). How many terms were added (what is the value of k)? Compare the output of the series to the output of the log command.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!