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 Center および File ExchangeCreating, 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