Question: 3. Now we'll try a while loop. Recall Ctrl + C is your friend. Recall from Calculus that we can represent some functions with as

3. Now we'll try a while loop. Recall Ctrl + C is your friend. Recall from Calculus that we can represent some functions with as infinite series. An exponential function f(x) = e* can be represented with a Taylor series e* = = Work through Sample Problem 6-7 on pages 198-199 and find a solution for x=8. Again, set x equal to something at the start of your section rather than using an input function 4. Now we're going to expand build on our Taylor series to look at several values of x. Calculating x=8 gets us close to our 30-term limit, let's see what happens with a few values smaller and larger than 8. To do this, put a for-loop around your while and if loops. Designate for x=(-10 -8 -.5 0 2 4 6 7 8 10). Give n, an, and their initial values inside the for-loop but outside the other two loops. This way, each time we go through the for-loop, x will increment to the next value in the vector and we will re-set the term of our series. The while-loop will run as many times as it needs to (or we allow it to) to estimate e' and then give us a result. Outside of the for-loop, open a new figure and turn hold on Inside the if-else-end, add a line in the else portion that plots a point X vs. s if the computation went to completion. Add a title and axis labels. 3. Now we'll try a while loop. Recall Ctrl + C is your friend. Recall from Calculus that we can represent some functions with as infinite series. An exponential function f(x) = e* can be represented with a Taylor series e* = = Work through Sample Problem 6-7 on pages 198-199 and find a solution for x=8. Again, set x equal to something at the start of your section rather than using an input function 4. Now we're going to expand build on our Taylor series to look at several values of x. Calculating x=8 gets us close to our 30-term limit, let's see what happens with a few values smaller and larger than 8. To do this, put a for-loop around your while and if loops. Designate for x=(-10 -8 -.5 0 2 4 6 7 8 10). Give n, an, and their initial values inside the for-loop but outside the other two loops. This way, each time we go through the for-loop, x will increment to the next value in the vector and we will re-set the term of our series. The while-loop will run as many times as it needs to (or we allow it to) to estimate e' and then give us a result. Outside of the for-loop, open a new figure and turn hold on Inside the if-else-end, add a line in the else portion that plots a point X vs. s if the computation went to completion. Add a title and axis labels
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
