calculating fourier series for the given functions and drawing the curve?
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!