diff options
Diffstat (limited to '149/CH10/EX10.7')
-rwxr-xr-x | 149/CH10/EX10.7/ques7.sce | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/149/CH10/EX10.7/ques7.sce b/149/CH10/EX10.7/ques7.sce new file mode 100755 index 000000000..13e9b311d --- /dev/null +++ b/149/CH10/EX10.7/ques7.sce @@ -0,0 +1,13 @@ +//ques1
+clc
+disp('finding the fourier series of given function');
+syms x
+ao=2/%pi*(integ(cos(x),x,0,%pi/2)+integ(-cos(x),x,%pi/2,%pi));
+s=ao/2;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ ai=2/%pi*(integ(cos(x)*cos(i*x),x,0,%pi/2)+integ(-cos(x)*cos(i*x),x,%pi/2,%pi));
+ //bi=1/%pi*(integ(-1*%pi*x^0*sin(i*x),x,-1*%pi,0)+integ(x*sin(i*x),x,0,%pi));
+ s=s+float(ai)*cos(i*x);
+end
+disp(float(s));
|