For completeness here is the code:
N=100;
dt=0.1;
t=(0:N)'*dt;
myBus.a = timeseries(sin(t),t);
myBus.b = timeseries(rand(size(t)),t);
However when try to run the simulation I receive the following error:
Error evaluating parameter 'OutDataTypeStr' in 'untitled/From Workspace'
Caused by: Cannot resolve variable 'busObj'
I am using MATLAB 2012b. I tried setting the output data type to double but then I receive the following error:
The From Workspace block 'untitled/From Workspace' is configured to load a structure of timeseries objects from the workspace, but its data type 'double' is not a bus data type. To load bus data in a From Workspace block, set the "Output data type" to 'Bus: BusObjectName'.
I have no idea what I am doing wrong. I followed the details in the tutorial shown above but for some reason Simulink will not run without error. I am also noticing in Simulink that the connection line is staying black, it is not turning into the bus object connector.
I don't want to use the method outlined in Import Structures of timeseries Objects for Buses because that involves going through the import GUI and the simulation I am working is complicated.
Can someone please help me?