Why do I receive an error when I use the IMPULSE function in the System Identification Toolbox 5.0.2 (R13)?
26 views (last 30 days)
Show older comments
Using the following code to calculate the impulse response:
a=[1 1 -274/800 -304/8000 7669/8000 ...
11652/16000 -1420/32000 -6636/32000 ...
-2646/64000];
b=[zeros(1,100) 1 -1 21/16 -1 5/16];
m=idarx(reshape(a,[1 1 9]),reshape(b,[1 1 105]));
u=idinput(1e5,'rgs');
e=randn(1e5,1);
y=sim(m,[u e]);
d=iddata(y,u);
I receive the following error:
??? Index exceeds matrix dimensions.
Error in ==> C:\MATLAB6p5\toolbox\ident\ident\@idmodel\impulse.m
On line 104 ==> varargin = varargin(1:kpf-1,kpf+2:end);
Error in ==> C:\MATLAB6p5\toolbox\ident\ident\@iddata\impulse.m
On line 161 ==> impulse(model,varargin{2:end});
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This is a bug in the System Identification Toolbox Version 5.0.2 (R13) in the way that the IMPULSE function handles the input arguments. There is an error on Line 104 of the IMPULSE function in System Identification Toolbox. Line 104 should look exactly like Line 123.
To work around this issue, you can:
1) Type the following command at the MATLAB command window to bring up the editor:
edit C:\MATLAB6p5\toolbox\ident\ident\@idmodel\impulse.m
2) Copy Line 123, which reads
varargin = varargin([1:kpf-1,kpf+2:end]);
3) Delete Line 104, which reads
varargin = varargin(1:kpf-1,kpf+2:end);
4) Paste the line copied from Line 123 to Line 104.
5) Save the file.
0 Comments
More Answers (0)
See Also
Categories
Find more on Linear Model Identification 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!