Main Content

iddata2timetable

Convert time-domain iddata object to timetable object

Since R2023a

Description

example

tt = iddata2timetable(data) creates the timetable object tt from the iddata object data.

tt retains the signal names from data as variable names. The software also converts other iddata properties, such as sample time, into timetable properties. For more information, see tt.

Examples

collapse all

Load the data, which is represented by an iddata object, and view the description of the contents.

load iddata1 z1
z1
z1 =

Time domain data set with 300 samples.
Sample time: 0.1 seconds               
                                       
Outputs      Unit (if specified)       
   y1                                  
                                       
Inputs       Unit (if specified)       
   u1                                  
                                       

View specific properties of z1.

z1.InputName
ans = 1×1 cell array
    {'u1'}

z1.OutputName
ans = 1×1 cell array
    {'y1'}

z1.Tstart
ans = 0.1000
z1.Ts
ans = 0.1000

Convert z1 to the timetable tt1.

tt1 = iddata2timetable(z1);
head(tt1,4)
     Time      u1       y1   
    _______    __    ________

    0.1 sec     1    -0.58724
    0.2 sec    -1      1.1082
    0.3 sec    -1     0.85908
    0.4 sec    -1     -2.2212

View the properties of tt1.

tt1.Properties
ans = 
  TimetableProperties with properties:

             Description: 'Time domain dataset with 1 inputs, 1 outputs and [300 1 1] samples.'
                UserData: []
          DimensionNames: {'Time'  'Variables'}
           VariableNames: {'u1'  'y1'}
    VariableDescriptions: {}
           VariableUnits: {''  ''}
      VariableContinuity: []
                RowTimes: [300×1 duration]
               StartTime: 0.1 sec
              SampleRate: 10.0000
                TimeStep: 0.1 sec
                  Events: []
        CustomProperties: No custom properties are set.
      Use addprop and rmprop to modify CustomProperties.

tt1 preserves the dimensions and properties of z1 that are equivalent to timetable properties.

Load two iddata objects, each of which contain the input/output data for a single experiment.

load iddata1 z1
load iddata3 z3

Merge the objects into a single multiexperiment object.

z13 = merge(z1,z3)
z13 =
Time domain data set containing 2 experiments.

Experiment   Samples      Sample Time          
   Exp1         300            0.1             
   Exp2         300            1               
                                               
Outputs      Unit (if specified)               
   y1                                          
                                               
Inputs       Unit (if specified)               
   u1                                          
                                               

Convert z13 to a timetable tt13.

tt13 = iddata2timetable(z13)
tt13=1×2 cell array
    {300×2 timetable}    {300×2 timetable}

tt13 is a cell array containing two timetables that correspond to the two experiments.

Input Arguments

collapse all

iddata object to convert, specified as a time-domain iddata object that can contain data from multiple experiments.

Output Arguments

collapse all

Timetable that contains the measurement data from data, returned as a timetable or, for multiexperiment data, a cell array of timetables. For multiexperiment data, the ith timetable in the cell array corresponds to the ith experiment in data.

In addition to the measurement data, the conversion process also extracts data property information and uses it to update the following equivalent timetable properties: VariableNames, VariableUnits, TimeStep, TimeUnit, and UserData.

Version History

Introduced in R2023a