Sum of a Series, Help!

Hi i have had a look around for some help on multiple variables using sum and sigma.
Couldnt quite understand how to apply those examples to my problem.
And I have got to write out this function and be able to plot it on a graph.
Being that n is 1,2 or 3 (on the same graph)
Pn(x) =

5 comentarios

Nathan Barnes
Nathan Barnes el 9 de Jul. de 2020
I do apologise if I broke ToS here, I would just like to remove the thread if that is ok?
madhan ravi
madhan ravi el 9 de Jul. de 2020
Why?
Stephen23
Stephen23 el 10 de Jul. de 2020
Original question by Nathan Barnes retrieved from Google Cache:
"Sum of a Series, Help!"
Hi i have had a look around for some help on multiple variables using sum and sigma.
Couldnt quite understand how to apply those examples to my problem.
And I have got to write out this function and be able to plot it on a graph.
Being that n is 1,2 or 3 (on the same graph)
madhan ravi
madhan ravi el 10 de Jul. de 2020
Thank you Stephen!
Rena Berman
Rena Berman el 22 de Jul. de 2020
(Answers Dev) Restored edit

Iniciar sesión para comentar.

Respuestas (2)

David Hill
David Hill el 9 de Jul. de 2020

0 votos

Not sure exactly what you are asking.
x=0:.1:10;
for n=1:3
S(n,:)=arrayfun(@(i)sum(repmat(-1,1,n+1).^(0:n)./(2*(0:n)+1).*repmat(i,1,n+1).^(2*(0:n)+1)),x);
end
subplot(3,1,1);
plot(x,S(1,:));
subplot(3,1,2);
plot(x,S(2,:));
subplot(3,1,3);
plot(x,S(3,:));

3 comentarios

madhan ravi
madhan ravi el 9 de Jul. de 2020
See after providing a complete solution usually the OP deletes the question. That’s why it’s better to provide hints than a complete solution.
Nathan Barnes
Nathan Barnes el 9 de Jul. de 2020
It is correct and I appreciate it very much, I'm sorry if I came off as ungreatful.
Rik
Rik el 9 de Jul. de 2020
Then why did you delete it?

Iniciar sesión para comentar.

Boxn Hen
Boxn Hen el 9 de Jul. de 2020

0 votos

Hope to help you as follow.Ps:I just use 'for' to sum all seperate results.
function result=SumAndSigma(x,n)
r(1)=0;
for i=0:n
r(i+2)=r(i+1)+((-1)^i/(2*i+1)).*x.^(2*i+1)% There are n+1 elements and the first one is 0.
end
result=r(2:end);
end
And input x and n to the function SumAndSIgma.
%for example:x=3;n=5
x=3;n=5;
result=SumAndSigma(x,n)
data=0:n;
plot(data,result);

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Productos

Versión

R2020a

Preguntada:

el 9 de Jul. de 2020

Comentada:

el 22 de Jul. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by