Why do I receive the error "The number of coefficients must equal the filter length" when using the file adaptfilt.rls in Filter Design Toolbox?

1 view (last 30 days)
For example:
M = 32; % Filter order
lam = 1; % Exponential weighting factor
delta = 0.1; % Initial input covariance estimate
w0 = zeros(M,1); % Initial tap weight vector
P0 = (1/delta)*eye(M,M); % Initial setting for the P matrix
Zi = zeros(M-1,1); % FIR filter initial states
%
% Adapt
%
Hadapt = adaptfilt.rls(M,lam,P0,w0,Zi);
Hadapt.ResetBeforeFiltering = 'off';
MM = 1;
[simmse,meanWsim,Wsim,traceKsim] = msesim(Hadapt,[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1],...
[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1],MM);
Hadapt.ResetBeforeFiltering = 'on';
??? The number of coefficients must equal the filter length.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This is a bug in the Filter Design Toolbox. There is an overloaded copy method used by ADAPTFILT which is causing this error.
To work around this issue, try the following:
1. Quit MATLAB
2. Rename the following P-file:
$MATLAB\toolbox\filterdesign\filterdesign\@adaptfilt\@rlswkalman\copy.p
(where $MATLAB = the MATLAB root directory on your machine)
Rename the file to copy.p.old
This will prevent the overloaded copy method from being called.
3. Restart MATLAB
4. After restarting MATLAB, issue the following command at the MATLAB prompt:
rehash toolboxcache

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!