summaryrefslogtreecommitdiff
path: root/149/CH10/EX10.11/ques11.sce
blob: cde2bd21a7a60d7a7bb3551bc6b99680a7a63748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//ques3
clc
disp('finding the fourier series of given function');
syms  x 
ao=0;
s=ao;
n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
for i=1:n
    bi=2/1*(integ((1/4-x)*sin(i*%pi*x),x,0,1/2)+integ((x-3/4)*sin(i*%pi*x),x,1/2,1));
  s=s+float(bi)*sin(i*%pi*x);
end
disp(float(s));