MATLAB: Do I see inconsistent data when logging signals at the output of an If Action Subsystem in Simulink 6.1 (R14SP1)

actioncostestimationfunctioniflargeloggingparametersignalsimulinkspesubsystemvirtual

When logging signals at the output of an If Action Subsystem, signal logging does not store the right time and data values.

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
We have verified that there is a bug in Simulink 6.1 (R14SP1) in the way that it handles logging signals at the output of If Action Subsystems, in particular, and virtual blocks in general. Also, if you are using Simulink Parameter Estimation, this problem will present itself by an error saying:
Error using => interp1: Y must have length(X) rows.
or by producing consistently large cost function values and non-converging estimations.
To work around this issue, put a Gain block with a gain of one at the output of the If Action Subsystem block or any other virtual subsystem block.