Path: news.mathworks.com!not-for-mail
From: "iqra " <scared_44@rocketmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: fourier series
Date: Sun, 17 Mar 2013 12:16:18 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <ki4c6i$p9$1@newscl01ah.mathworks.com>
Reply-To: "iqra " <scared_44@rocketmail.com>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1363522578 809 172.30.248.37 (17 Mar 2013 12:16:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 17 Mar 2013 12:16:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 4157198
Xref: news.mathworks.com comp.soft-sys.matlab:791345

this piece of code is for fourier series calculation but its giving me error at syms,,plz can anyone help me..
>> L=8;
>>syms n x

>>a_n=sqrt(2/L)*(2*L)/(n*pi)*((sin((n*pi)/2))^2)*sin(n*pi)%fourier coefficient a_n
>>b_n=-sqrt(2/L)*((2*L)/(n*pi))*((sin((n*pi)/2))^2)*cos(n/pi)
>>vx=symsum(a_n*sqrt(2/L)*cos(n*2*pi*x)/L,n,1,9);
>>plot(x,v_x);
>>grid on;
>>axis([0 8 -1.4 1.4]);
>>hold on;
??? >>syms n x;
    |
Error: Unexpected MATLAB operator.