Summation Problem (symsum)

10 vues (au cours des 30 derniers jours)
Lockedfield
Lockedfield le 21 Avr 2020
Commenté : Lockedfield le 21 Avr 2020
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 commentaires
Jeff Alderson
Jeff Alderson le 21 Avr 2020
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 le 21 Avr 2020
Thank you for the reply, actually thats not a phone number

Connectez-vous pour commenter.

Réponses (0)

Communautés

Plus de réponses dans  Distance Learning Community

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by