MATLAB: Is there a way to create Simulink.TsArray objects in the MATLAB workspace to be read in by an Inport in Simulink 6.4 (R2006a)

bussimulinksimulink.tsarraytimeseriestsarray

The documentation says bus signals are logged as TsArray. These TsArray objects can then be fed back into an Inport by following the directions outlined at:
Importing Time-Series Data
I was wondering if there was a way to create this TsArray without having to log it from a model. I want to create it in the MATLAB workspace from a script and then feed the data into a model.

Best Answer

In MATLAB 7.12 (R2011a), it is recommended to use a structure of MATLAB timeseries objects to import bus signals into a simulation. This is explained here:
See attached files createdata_R2011a.m and testMDL_R2011a.mdl for an example
For versions prior to MATLAB 7.12 (R2011a), it is possible to create a Simulink.TsArray object in the MATLAB workspace. The attached files simple_script.m and simple.mdl reads the data in from the workspace into a bus. Note that the schema.prop method needed for versions prior to R2011a is subject to change in future releases.