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: Undefined variable or function 'b'
Replies: 1   Last Post: May 10, 2013 1:28 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1
Registered: 5/10/13
Undefined variable or function 'b'
Posted: May 10, 2013 1:20 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I don't understand why it's not reading from the script when I enter these commands

subplot(2,1,1), zplane(b),title('zplance of FIR'), ylabel('Imaginary part'), xlabel('Real Part')
subplot(2,1,2), plot(w,abs(fr)),title('Magnitude of Frequency Response'), ylabel('Amplitude'), xlabel('w(pi)')

it always says undefined variable 'b'
Ive made sure its headed to the right folder and everything.

Here is my code:

FIR_Input1c ='C:\Users\niel0512\Desktop\DSF\FIR_Input1c';
[X, FS, NBITS] = wavread(FIR_Input1c);

FIR_Input1 = 'C:\Users\niel0512\Desktop\DSF\FIR_Input1';
[O, FS, NBITS] = wavread(FIR_Input1);

z1 = exp(.3*pi*1i);
z2 = exp(-.3*pi*1i);
z3 = exp(.5*pi*1i);
z4 = exp(-.5*pi*1i);
z5 = exp(.8*pi*1i);
z6 = exp(-.8*pi*1i);
z7 = -1;

b=conv([1, -z1],[1, -z2]);

b = b./8;
a = 1;


y= filter(b,a,X);
y= real(y);

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

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.