Hello guys , please help me !

Let the series S= ∑ 1/k!. Noting Sn=∑ 1/k! with partial sum of order n, write a program that receives as argument a strictly positive real number and subunit er displays all partial sums for which sn-e > er. After every 10 sums shown the user has to press a key before displaying the following sums. The program displays an error message if requirements are not met regarding the argument.
Help me please :D !
Thank you !

Réponses (2)

Image Analyst
Image Analyst le 16 Mar 2014
Modifié(e) : Image Analyst le 16 Mar 2014

0 votes

Hints, functions you may find useful: factorial(), mod() or rem(), sum(), uiwait(warndlg()), msgbox(), and fprintf(). Also look up for loops and how a function works. And after you read this, this, and this, if you still have problems then you can then read this and come back with your homework code and we'll help you through it..
Roger Stafford
Roger Stafford le 16 Mar 2014

0 votes

Another hint. The quantity S of the infinite sum is the value of exp(x) when x = 1, assuming k starts at k = 0, so the 'e' you use should be exp(1).
The inequality you mention looks incorrect, since your Sn will always be less than the limit S (which is e.) Hence Sn-e is always negative.

Catégories

En savoir plus sur Scope Variables and Generate Names dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by