MATLAB: Are frd objects not able to handle a single input value while concatenating within the Control System Toolbox 5.2 (R13)

concatenationcontrolControl System Toolboxfrdhorizontalinputvertical

If I create an frd object with one input value and then try to concatenate the object with itself, I receive an error.
The following code demonstrates this behavior:
sys=frd(1,1);
sys2=[sys,sys];
??? Index of element to remove exceeds matrix dimensions.
Error in ==> E:\matlab\toolbox\control\control\@frd\horzcat.m
On line 62 ==> sizeSys(3) = []; % remove freq dimension

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, read below for any possible workarounds:
This is a bug in the Control System Toolbox 5.2 (R13).
You can work around this issue by modifying the following piece of code in
$MATLABROOT\toolbox\control\control\@frd\horzcat.m
[where $MATLABROOT = MATLAB's root directory ]
Change the following code:
sizeSys(3) = []; % remove freq dimension

to read as follows:
if length(sizeSys) > 2
sizeSys(3) = []; % remove freq dimension
end