blob: 9f8369333c720846131fe3234afdd3795b616b56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
//ques9
clc
disp('finding the fourier series of given function');
syms x l
s=0;
n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
for i=1:n
// ai=1/l*integ(exp(-x)*cos(i*%pi*x/l),x,-l,l);
bi=integ(x*sin(i*%pi*x/2),x,0,2);
s=s+float(bi)*sin(i*%pi*x/2);
end
disp(float(s));
|