how to plot a summation function in matlab using a for loop
Mostra commenti meno recenti
how can i plot this summation function using a for loop?

i start write this:
t = -pi : pi/6 : pi;
s=0;
for i = 0:1
s=s+(2/3)*(pi^2) + ((-1)^i)* (-4*cos(i*t))/i^2
Risposta accettata
Più risposte (1)
For reference:
syms k t
f(t) = 4*symsum((-1)^(k+1)*cos(k*t)/k^2,k,1,Inf)
f(0)
fplot(f+2/3*pi^2,[-2*pi,2*pi])
Categorie
Scopri di più su Mathematics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
