MATLAB: Does the Simulink.TimeSeries object get referenced and not copied in Simulink 7.4 (R2009b)

simulink

I am trying to copy the Simulink.TimeSeries object in Simulink 7.4 (R2009b) by executing the following steps.
1. Open the demo model 'vdp', log the signal "x1" and simulate the model.
2. Save the created variable 'logsout' in a MAT-file and clear the workspace.
3. Load the MAT-file and execute the following commands at the MATLAB Command Prompt.
a = logsout.copy
resample(a.x1,0:1:10)
I notice that both 'logsout' and 'a' now contain 11 elements. So 'a' is a reference of 'logsout'.
I expect the copy method to create a deep copy of the original TimeSeries object. When doing the copy just after the model runs, 'a' is a deep copy of 'logsout' and resampling it does not affect the original variable 'logsout'.

Best Answer

The ability to copy the Simulink.TimeSeries object is not available in Simulink.
To work around this issue, you need to unpack the data by executing the following commands.
load file.mat
logsout.unpack
a = x1.copy
resample(a, 0:1:10)