Error While Using the butter() function for IIR Butterworth filter design
Show older comments
I am using Matlab 2012a. My code for the design of IIR Butterworth filter is:
clc
clear all
Fs=1000;
fc=300;
WC=2*pi*fc;
N=5;
[b,a]=butter(N,WC,'s');
[z,p,k]=butter(N,WC,'s');
[bz,az]=ipminvar(b,a,Fs);
[h, f]=freqz(bz,az,512,Fs);
plot(f, 20*log10(asb(h))),grid;
xlabel('frequency(Hz)');
ylabel('Magnitude(dB)');
The error encountered after execution of the program is:
??? Attempt to execute SCRIPT butter as a function: E:\Academics\6th Sem\DSP Lab\Exp-8\butter.m
Error in ==> butter at 8 [b,a]=butter(N,WC,'s');
Signal Processing Toolbox is already present in my Matlab. I have checked it using
>>ver
Please help me to debug the problem.
Accepted Answer
More Answers (1)
Honglei Chen
on 4 Apr 2012
0 votes
This error
??? Attempt to execute SCRIPT butter as a function: E:\Academics\6th Sem\DSP Lab\Exp-8\butter.m
indicates that you have a butter.m on your path that shadowed MATLAB's butter() function. You need to either remove it from the path or change its name to something other than butter.
Categories
Find more on Butterworth in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!