This is the expected behavior. All blocks in an iterator subsystem will be executed at each iteration point, so the 'To Workspace' block will log all points, even though time is not changing.
This explains why the vectors 'two' and 'four' workspace variables are of unequal lengths, eventhough they refer to the same signal. In particular, the length of the vector 'two' is greater than the length of vector 'four'.
In order to make both these signals of the same length, the vector 'two' can be modified as shown in the code below:
two.signals.values(find(~[diff(two.time); 1]))=[];
two.time(find(~[diff(two.time); 1]))=[];
This will ensure logging of a single value per time point.
However, there is no Sink block in SIMULINK that can achieve logging of a single value per time point automatically.
Best Answer