Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: fourier series
Replies: 1   Last Post: Apr 4, 2013 5:17 AM

 Christopher Creutzig Posts: 323 Registered: 2/24/09
Re: fourier series
Posted: Apr 4, 2013 5:17 AM

On 17.03.13 13:16, iqra wrote:
> 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.
>

That looks like you copied & pasted something someone sent to you. Don't
include the ?>>? in what you copy and paste to MATLAB, only copy the
parts behind that, the ?>>? is the MATLAB prompt.

HTH,
Christopher