Need some help with a function and With my code
Show older comments
Hello!
I need some help. I got this question that im trying to answer......Please let me know How you would do this problem. I am so lost.
Leibnitz (the other Calculus guy) proved that the following infinite alternating series converges (very slowly) to pi. You are going to investigate just how slowly.

Create a function named partsum, that calculates the sum of a given number of terms (i.e., the Nth partial sum)

In the function, create a vector of terms (sequence) that is then added to determine the sum. The function should take as input a scalar N (not a vector) and return two outputs, the sum and the vector of terms.
In my .m file I will need to call the function for the values N = 5, 50, 500, and 5000, and determine the error for each. Use the table function to report your results.
Your output to the console should look like this:
Terms Error
_____ ________
5 0.19809
50 0.019998
500 0.002
5000 0.0002
Please let me know ASAP
Thank you
Daniel
6 Comments
Rik
on 18 Jul 2021
You can find guidelines for posting homework on this forum here. If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). If your main issue is with understanding the underlying concept, you may consider re-reading the material you teacher provided and ask them for further clarification.
Daniel Vonderhaar
on 18 Jul 2021
Walter Roberson
on 18 Jul 2021
It is not a homework question? Then it must be an exam question.
Daniel Vonderhaar
on 18 Jul 2021
Daniel Vonderhaar
on 18 Jul 2021
Walter Roberson
on 18 Jul 2021
You got a response within 8 minutes. A possibility of a complete solution before an exam finished has more value than no solution at all, correct?
People do post exam questions while they are in the middle of writing exams.
Well think whatever you want
I have answered more than 50000 Questions. I have seen a lot of homework questions posted, and this was definitely a homework question.
I have also seen a number of cases where someone swears that something is not a homework question, but then the next day someone else posts the exact same question, and when this is pointed out the second person says something like, "Oh yes, that other person is in the same class as I am."
Accepted Answer
More Answers (0)
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!