Create a tall timetable for a signal in the Simulation Data Inspector repository. You can create a tall timetable for a signal in the Simulation Data Inspector repository using a Simulink.sdi.Signal
object or by first creating a matlab.io.datastore.sdidatastore
object for the signal. You can use a matlab.io.datastore.sdidatastore
object to incrementally read and process signal data for signals that do not fit into memory. A tall timetable handles the data chunking and processing in the background. In general, you can work with tall timetables very similarly to how you work with in-memory data.
Create Data and Access Signal ID
Whether you create a tall timetable using a Simulink.sdi.Signal
object or a matlab.io.datastore.sdidatastore
, start by creating data and accessing the signal ID for a signal of interest. The sldemo_fuelsys
model is configured to log signals which stream to the Simulation Data Inspector repository when you simulate the model.
Use the Simulation Data Inspector programmatic interface to access a signal ID. For example, access the ego
signal.
Create Tall Timetable Using matlab.io.datastore.sdidatastore
Object
In general, tall timetables are backed by datastores. Create a matlab.io.datastore.sdidatastore
object to reference the signal data in the Simulation Data Inspector repository.
Check the name of the datastore to verify you have the signal you expect.
Create a tall timetable from the matlab.io.datastore.sdidatastore
object to use for processing the signal data. When you have a Parallel Computing Toolbox™ license, you need to explicitly set the execution environment to the local MATLAB® session using mapreducer
before creating the tall timetable. The matlab.io.datastore.sdidatastore
object does not support parallel computations.
egoTt =
Mx1 tall timetable
Time Data
______________ ______
0 sec 1.2855
0.00056195 sec 1.2855
0.0033717 sec 1.2855
0.01 sec 1.2398
0.02 sec 1.199
0.03 sec 1.1628
0.04 sec 1.1309
0.043098 sec 1.1309
: :
: :
Create Tall Timetable Using Simulink.sdi.Signal
Object
The Simulink.sdi.Signal
object has a function to create a tall timetable directly, allowing you to skip the step of creating a datastore by creating it behind the scenes. Use the signal ID to access the Simulink.sdi.Signal
object for the ego
signal. Then, use the getTable
function to create the tall timetable.
egoTt =
Mx1 tall timetable
Time Data
______________ ______
0 sec 1.2855
0.00056195 sec 1.2855
0.0033717 sec 1.2855
0.01 sec 1.2398
0.02 sec 1.199
0.03 sec 1.1628
0.04 sec 1.1309
0.043098 sec 1.1309
: :
: :
Use Tall Timetable to Process Signal Data
When you use the tall timetable egoTt
, its underlying datastore reads chunks of data and passes them to the tall timetable to process. Neither the datastore nor the tall timetable retain any of the data in memory after processing. Also, the tall timetable defers processing for many operations. For example, calculate the mean value of the signal.
You can use the gather
function to evaluate a variable and write its value to the workspace, or you can use the write
function to write the results to disc. When you use gather
, be sure the results fit into memory.
Evaluating tall expression using the Local MATLAB Session:
- Pass 1 of 1: Completed in 0.96 sec
Evaluation completed in 1.1 sec
When you perform multiple operations on a tall timetable, evaluation of the results for each step is deferred until you explicitly request the results with write
or gather
. During evaluation, MATLAB optimizes the number of passes it makes through the tall timetable, which can significantly speed up processing time for analyzing very large signals. For more information about working with tall arrays, see Tall Arrays for Out-of-Memory Data.