help-octave
[Top][All Lists]

Re: Error on Filter function

 From: Doug Stewart Subject: Re: Error on Filter function Date: Sat, 26 Sep 2015 16:57:21 -0400

On Sat, Sep 26, 2015 at 4:53 PM, Doug Stewart wrote:

On Sat, Sep 26, 2015 at 3:40 PM, Christian D'Aquino wrote:
Hi, I'm trying to run a butterworth filter, from a code example I found on the documentation package. This is the code I'm using:

sf = 800; sf2 = sf/2;
data=""
[b,a]=butter ( 1, 50 / sf2 );
filtered = filter(b,a,data);

clf
subplot ( columns ( filtered ), 1, 1)
plot(filtered(:,1),";Impulse response;")
subplot ( columns ( filtered ), 1, 2 )
plot(filtered(:,2),";25Hz response;")
subplot ( columns ( filtered ), 1, 3 )
plot(filtered(:,3),";50Hz response;")
subplot ( columns ( filtered ), 1, 4 )
plot(filtered(:,4),";100Hz response;")

And this is the error I keep getting:

>> filter
error: invalid use of script C:\Users\Ingo\filter.m in index _expression_
error: called from
filter at line 4 column 11

Can anyone help me understand what's wrong here?
Thanks,
Christian

I just ran your code and did not get an error!!

What version of octave?
what OS?

Do you have a different filter.m file in your home folder?