You do not need a for loop. If you have Symbolic Toolbox, the following code should do it:
syms f(t) n k=5; %upper limit for series f0=5000; f(t)=symsum((4/((2*n-1)*pi))*sin(2*pi*n*f0.*t),n,1,k)
You do not need a for loop. If you have Symbolic Toolbox, the following code should do it:
syms f(t) n k=5; %upper limit for series f0=5000; f(t)=symsum((4/((2*n-1)*pi))*sin(2*pi*n*f0.*t),n,1,k)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!