summaryrefslogtreecommitdiff
path: root/149/CH10/EX10.5/ques5.sce
blob: 307c0987b4319106aaac44cd0396b8b2bf40cc64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//ques5
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 terms in the expansion : ');
for i=1:n
  
   bi=2/%pi*integ(x*sin(i*x),x,0,%pi);
  s=s+float(bi)*sin(i*x);
end
disp(float(s));