# Plotting Fourier Series Expansion

9 views (last 30 days)

Show older comments

### Accepted Answer

Paul
on 9 Mar 2023

Hi Hanif,

Maybe this will help.

First, the problem statement says that one period spans -1 < x <= 1 (I don't think it matter if using < or <=)

x = linspace(-1,1,100);

Instead of using your problem, let's do something simpler, like 1 - 2*sum(n=1:5,n*x)

fsum = 0*x; % initialize

for n = 1:5

fsum = fsum + n*x;

end

plot(x,1-2*fsum)

I think you can adapt that to your problem. Of course we can't compute an infinite sum, so you'll have to pick an upper bound for the sum over n.

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!