简体   繁体   中英

Getting the error “ `butter' undefined” in Octave. How to fix it?

When I write this line in Octave:

[b,a] = butter (5,0.2);

I get the error:

error: `butter' undefined near line 1 column 10

How can I get rid of it? Thanks.

Seems that you forgot to load the signal package. You have to install and load it in order to use the butter function:

pkg install -forge signal
pkg load signal
[b,a] = butter (5,0.2);

Please take a look in the Octave documentation . It explains how to install and how to load packages.

The butter function is part of the signal package. You need to download, install and load the package before you can use its functions:

>> pkg install -forge signal
>> pkg load signal

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM