From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 149/CH10/EX10.1/ques1.sce | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 149/CH10/EX10.1/ques1.sce (limited to '149/CH10/EX10.1/ques1.sce') diff --git a/149/CH10/EX10.1/ques1.sce b/149/CH10/EX10.1/ques1.sce new file mode 100755 index 000000000..383f7dde4 --- /dev/null +++ b/149/CH10/EX10.1/ques1.sce @@ -0,0 +1,13 @@ +//ques1 +clc +disp('finding the fourier series of given function'); +syms x +ao=1/%pi*integ(exp(-1*x),x,0,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=1/%pi*integ(exp(-x)*cos(i*x),x,0,2*%pi); + bi=1/%pi*integ(exp(-x)*sin(i*x),x,0,2*%pi); + s=s+float(ai)*cos(i*x)+float(bi)*sin(i*x); +end +disp(float(s)); -- cgit