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