主要内容

数据set signal format

Description

Format for logged数据set叶子元素。

Category:数据导入/导出

环境s

Default:timeseries

timeseries

节省数据setMATLAB中的元素值®timeseries格式。

timetable

节省数据setMATLAB中的元素值timetable格式。

Comparison of Formats

timetable格式enables easier merging of logged data from multiple simulations.

Property Display

timeseries格式displays one field for time properties (TimeInfo) and a second field for data properties (Datainfo)。例如,以下是timeseriesobject for a nonscalar signal.

ts
次数公共属性:名称:''时间:[1001x1 double] timeInfo:[1x1 tsdata.timemetadata]数据:[1001x1 double] datainfo:[1x1 tsdata.datametadata]

When you enter the name of atimetableobject (for example,tt)并查询属性,您会看到所有属性。

tt.Properties
ans = with files:descripts:''userData:[] dimensionNames:{'time''''''} variabledescriptions:{} variablenames:['wend''wendspeed'windspeed'winddirection'] variableunits variableunits:{}']行时间:[64x1持续时间]

数据访问

访问已记录的数据timeseries格式, use the数据property for a signal. For example, for atimeseriesobjectts(only first five values shown):

ts = yout{1}.Values; ts.Data
ans = 0 -0.0002 -0.0012 -0.0062 -0.0306

timetable格式for logged数据set数据生成一个带有一个时间列的表格,称为Time, and one data column, called数据。这Timecolumn is the simulation time vector for a given signal, stored as a duration type, with the setting of seconds to match the units of simulation time, starting with the simulation start time (typically set to0 sec)。Simu金宝applink®signal dimensions of[n][nx1]are treated equivalently in thetimetablerepresentation. For example, for atimetableobjecttt(only first five values shown):

tt = yout{1}.Values; tt.Data
时间数据_________ ____________ 0秒[1x3x2 double] 0.1秒[1x3x2 double] 0.2秒[1x3x2 double] 0.3 sec [1x3x2 double] 0.4 sec [1x3x2 double]

这number of samples is the first dimension in the数据column of thetimetableobject, but it is the last dimension in the data field of loggedtimeseriesdata that isnonscalar。这refore, when you access data intimetable格式,您可能需要重塑每个样本是非尺度阵列时的数据。一种选择是使用squeezefunction. For example, to access the first data row in the dataset, you can use a command like this:

squeeze(tt.Data{1,1})
ans = 1 2 3 4 5 6

If a signal is a bus or array of buses, the signal values are logged as a structure oftimetableobjects, with each leaf of the structure corresponding to the logged result of each leaf signal in the bus.

单位

For data logged in Simulink, thetimeseries格式displays units for time values in the单位property. Units can be specified as any value of any class. Timeseries logging sets the units to aSimulink.SimulationData.Unitobject, if the logged signal has units specified. For loading, units are honored only if they are of typeSimulink.SimulationData.Unit; otherwise, they are ignored.

For thetimetable格式, Simulink does not support units for logged data.

数据插值

timeseries格式Interpolation属性显示插值方法是否为linear(default) orZoh

timetable格式VariableContinuityproperty characterizes variables as continuous or discrete. The possible values for simulation data are:

  • 连续的– Corresponds to thetimeseriespropertyInterpolationsetting oflinear。Simulink uses this setting for filling continuous sample times.

  • step– Corresponds to thetimeseriespropertyInterpolationsetting ofZoh

    Simulink uses this setting for filling discrete sample times.

均匀和非均匀时间

timeseries格式displays whether the time data is uniform or nonuniform. For data logged for continuous sample times (linear interpolation), theTimeInfo属性表明时间不均匀并给出长度。对于离散的样本时间(零级保持插值),TimeInfo属性表示时间均匀,并给出长度和增量。

timetable格式does not have a property for uniform and nonuniform time data.

用于数据timeseries或者timetable格式, you can use the MATLAB是规则功能以获取此时间信息。

Signal Name

timeseries格式stores the name of a logged signal in aSimulink.SimulationData.Elementwrapper object, as well as in thetimeseries对象本身。

timetable格式stores the name of a logged signal in aSimulink.SimulationData.Element包装对象,但不在timetable对象本身。

Tips

  • 数据set signal formatparameter has no effect when usingScopeblocks to log data.

命令行信息

范围:数据setSignalFormat
Value:'时间序列'|'时间表'
Default:'时间序列'

Recommended Settings

Application 环境
Debugging 没有影响
Traceability 没有影响
Efficiency

没有建议

Safety precaution

没有建议

相关话题