Summation Problem (symsum)

조회 수: 11 (최근 30일)
Lockedfield
Lockedfield 2020년 4월 21일
댓글: Lockedfield 2020년 4월 21일
To be honest im not a teacher nor lecturer, im a student having difficulty code some problem about summation (symsum).
What im trying to do is to search for code to make table epsilon_s>epsilon a From the question above.
Epsilon_s = 0,5*10^(2-n)
Heres some code from my previous homework (i got this answer also from this website, shout out to Ameer)
function maclaurin2
term_n = @(x,n) x^n./factorial(n); % formula for n-th term of series
N = 10; % total number of terms we are going to calculate
result = zeros(1,N+1); % initializng a array to save the partial sums
eplison_t = zeros(1,N+1);
eplison_a = zeros(1,N+1);
x = 1/2; % value of x to use in this calculation
result(1) = term_n(x,0); % calculate first term of the series at n=0
eplison_t(1) = (exp(x) - result(1))/exp(x);
for n=1:N % terms n=1,2,...,N
result(n+1) = result(n) + term_n(x,n); % current partial sum is the addition of last partial sum and the value of n-th term
eplison_t(n+1) = (exp(x) - result(n+1))/exp(x);
eplison_a(n+1) = (result(n+1)-result(n))/result(n+1);
end
eplison_t = 100*eplison_t;
eplison_a = 100*eplison_a;
t = table(result', eplison_t', eplison_a');
disp(t)
end
Any form of help will be highly appriciated!
  댓글 수: 2
Jeff Alderson
Jeff Alderson 2020년 4월 21일
Documentation on the symsum command is available here: https://www.mathworks.com/help/symbolic/symsum.html
Unfortunately, we can't help you with answers about specific homework assignments in this forum.
Also, you may want to edit your existing post to remove any screenshots that are showing phone numbers.
Lockedfield
Lockedfield 2020년 4월 21일
Thank you for the reply, actually thats not a phone number

댓글을 달려면 로그인하십시오.

답변 (0개)

커뮤니티

더 많은 답변 보기:  원격 교육 커뮤니티

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by