Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Christopher Creutzig

Posts: 256
Registered: 2/24/09
Re: fourier series
Posted: Apr 4, 2013 5:17 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.