Summation Problem (symsum)

11 visualizaciones (últimos 30 días)
Lockedfield
Lockedfield el 21 de Abr. de 2020
Comentada: Lockedfield el 21 de Abr. de 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 comentarios
Jeff Alderson
Jeff Alderson el 21 de Abr. de 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 el 21 de Abr. de 2020
Thank you for the reply, actually thats not a phone number

Iniciar sesión para comentar.

Respuestas (0)

Comunidades de usuarios

Más respuestas en  Distance Learning Community

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by