Summation Problem (symsum)

11 views (last 30 days)
Lockedfield
Lockedfield on 21 Apr 2020
Commented: Lockedfield on 21 Apr 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 Comments
Jeff Alderson
Jeff Alderson on 21 Apr 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 on 21 Apr 2020
Thank you for the reply, actually thats not a phone number

Sign in to comment.

Answers (0)

Communities

More Answers in the  Distance Learning Community

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!