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.4/ques4.sce | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 149/CH10/EX10.4/ques4.sce (limited to '149/CH10/EX10.4/ques4.sce') diff --git a/149/CH10/EX10.4/ques4.sce b/149/CH10/EX10.4/ques4.sce new file mode 100755 index 000000000..ca427a584 --- /dev/null +++ b/149/CH10/EX10.4/ques4.sce @@ -0,0 +1,13 @@ +//ques4 +clc +disp('finding the fourier series of given function'); +syms x l +ao=1/l*integ(exp(-1*x),x,-l,l); +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/l*integ(exp(-x)*cos(i*%pi*x/l),x,-l,l); + bi=1/l*integ(exp(-x)*sin(i*%pi*x/l),x,-l,l); + s=s+float(ai)*cos(i*%pi*x/l)+float(bi)*sin(i*%pi*x/l); +end +disp(float(s)); -- cgit