How to form an array of sums?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi, I am asked to evaluate the following sum S=Sigma(n=0 to N) x^n/n! (namely, e^x as n->Inf) for N=10:10:100 and x=10, so that every element S(i) is a partial sum which approximates function e^x with different accuracy. Below is my code, which doesn't work:
x=10; N=10:10:100; S=symsum(x^n/sym('n!'), n, 0, N)
Would anyone please tell me where I am going wrong and how it may be corrected? I'd appreciate some guidance.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!