MATLAB: Do I receive an error using the HORZCAT command with IDDATA objects in System Identification Toolbox 5.0 (R13SP1)

concatenateerrorhorzcatiddataidentificationintersamplesystemSystem Identification Toolboxtoolbox

Using the System Identification Toolbox 5.0 (R13SP1), when I create two simple IDDATA objects and concatenate them using HORZCAT, I get an error.
The following lines of code cause an error:
 
d1 = iddata( rand( 10, 1 ), [], 1, 'OutputName', {'a'} );
d2 = iddata( rand( 10, 1 ), [], 1, 'OutputName', {'b'} );
[ d1 d2 ]
 
??? Index exceeds matrix dimensions.
Error in ==> \\pc2unix\ARCHIVE\R13\fcs\ship\pc\dist\toolbox\ident\ident\@iddata\horzcat.m
On line 74 ==> internew(:,kk) = datt.InterSample(novu,kk);

Best Answer

This is a bug in System Identification Toolbox 5.0 (R13SP1) in the way that HORZCAT handles IDDATA objects.
The problem occurs because the "InterSample" property of the IDDATA object is by default set to an empty string and HORZCAT tries to index into it.
To work around this issue, try setting the "InterSample" property of the IDDATA objects to a valid value ('zoh', 'foh' or 'bl'). For more information on IDDATA properties, refer to the following URL:
and look under the "iddata Properties" section.