Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I need help with Euler's number

조회 수: 1 (최근 30일)
Ozario Pasquallie
Ozario Pasquallie 2018년 4월 12일
마감: John D'Errico 2020년 3월 17일
Question 1
The Euler's number (e) is an important mathematical constant that forms the base of the natural logarithms. This number can be obtained in MATLAB by typing: exp(1), in other words, e to the power of 1. The exact value of e can be defined by the infinite series:
where n! is the factorial of n.
You are asked to create a MATLAB M-file named “question1.m” (exactly like this, without capital letters or spaces) that
  1. uses a for loop to display in the Command Window the first 10 terms in the sequence. Hint:the factorial of n (or n!) in MATLAB is obtained by typing factorial(n).
  2. calculates the series using the first 10 terms.
  3. obtains the error of the previous series (in %) with respect to the value of e that is stored in the memory of MATLAB.
  4. creates a plot in which the number of terms that are included in the series appears in the abscissa (x) and the result of the series for the corresponding number of terms appears in the ordinate (y). The line should contain ‘x’ markers to indicate each value of the series.
  5. includes in the plot useful labels and a line at y = e to represent the value to which the series should converge.
  댓글 수: 4
R.D
R.D 2020년 3월 17일
Where can I find the answer in the above question?
Geoff Hayes
Geoff Hayes 2020년 3월 17일
Romario - why not trying to code this yourself? The question seems fairly clear on what needs to be done.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by