MATLAB: How to implement a zero sized signal using blocks in Simulink 7.6 (R2010b)

simulink

I have an Embedded MATLAB Block implementation of how to output an empty signal in simulink in the attached model and it works fine in Simulink. I would like to perform the equivalent task without using an Embedded Matlab Block, but, only core Simulink blocks.
I would like to send to an output a zero sized signal for a specified input dimension at a non zero time, when the time value is lesser than a threshold value.
The way that I use the zero size signal assignment in Embedded MATLAB function block is as below:
function y = nullout(time,u,thresh)
%#eml
if time > thresh
y=u;
else
y = [];
end
end

Best Answer

There is no direct way to output a signal of size zero using a Simulink block in Simulink 7.6 (R2010b).
As a workaround, you can use an Enabled Subsystem block which can always be set to disabled for all time values while its outputs are set to variable size. Connecting this output to signal path, forces the signal to be zero sized when it is selected.
The model example 'sample_model.mdl' attached to this solution illustrates this case. In this example, the Enabled Subsystem block output is set to be variable sized and its initial value set to "[]", that forces the output to have a size of 0 as long as the subsystem is disabled.