calculating fourier series for the given functions and drawing the curve?

1 view (last 30 days)
hey guys, one of my friends has just given me a question.I wrote the code for it but don't know how to draw the chart or curve for that,would you please help me out...??thanks
here's the code: clc syms x f=exp(-abs(x)); N=15; a_0=(1/pi)*int(f*cos(0*x),-pi,pi) for n=1:N a_n(n)=(1/pi)*int(f*cos(n*x),-pi,pi); b_n(n)=(1/pi)*int(f*sin(n*x),-pi,pi); end a_n b_n f_new=a_0/2; for n=1:N f_new=f_new+a_n(n)*cos(n*x)+b_n(n)*sin(n*x); end

Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!