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 !
回答 (2 件)
Image Analyst
2014 年 3 月 16 日
編集済み: Image Analyst
2014 年 3 月 16 日
0 投票
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
2014 年 3 月 16 日
0 投票
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.
カテゴリ
ヘルプ センター および File Exchange で Scope Variables and Generate Names についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!