I want to show basic fourier series by using matlab.
I don't know where did I wrong please fix my code...
this code keeps making error in matlab.
function fv = f(x, N)
fv = 0;
for n=1:N
fv = fv + (1/(2*n-1) *sin((2*n-1)*x);
end
x = 0:0.1:100;
N = 10;
plot(x, f(x, N))
I mean I wanna show $f(x)= sin(x)+\frac{1}{3}sin(3x)+\frac{1}{5}sin(5x)+.....\frac{1}{2n-1}sin(2n-1)$ when n=10 into matlab code. help me.
to simplify
I modified