Error While Using the butter() function for IIR Butterworth filter design
显示 更早的评论
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.
采纳的回答
更多回答(1 个)
Honglei Chen
2012-4-4
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Butterworth 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!