文档

万博1manbetxSimulink.SimulationData.createStructOfTimeseries

创建一个结构MATLABtimeseries对象叶节点

语法

struct_of_ts = 万博1manbetxSimulink.SimulationData.createStructOfTimeseries(tsArrayObject)
struct_of_ts = 万博1manbetxSimulink.SimulationData.createStructOfTimeseries(busObj,structOfTimeseries)
struct_of_ts = 万博1manbetxSimulink.SimulationData.createStructOfTimeseries(busObj,cellOfTimeseries)
struct_of_ts = 万博1manbetxSimulink.SimulationData.createStructOfTimeseries(busObj,cellOfTimeseries,dims)

描述

例子

struct_of_ts = 万博1manbetxSimulink.SimulationData.createStructOfTimeseries(tsArrayObject创建了MATLAB的结构®timeseries的对象。万博1manbetx仿真软件。TsArray对象。将此语法用于在R2016a之前的版本中模拟的模型的信号日志数据ModelDataLogs信号日志记录格式。

例子

struct_of_ts = 万博1manbetxSimulink.SimulationData.createStructOfTimeseries(busObjstructOfTimeseries创建与总线对象的属性匹配的结构busObj并利用MATLAB的结构设置结构叶节点的值timeseries对象structOfTimeseries.当使用部分结构作为创建要加载到模型中的完整结构的基础时,请使用此语法。

struct_of_ts = 万博1manbetxSimulink.SimulationData.createStructOfTimeseries(busObjcellOfTimeseries创建与总线对象的属性匹配的结构busObj并利用MATLAB的单元数组设置结构叶节点的值timeseries对象cellOfTimeseries

例子

struct_of_ts = 万博1manbetxSimulink.SimulationData.createStructOfTimeseries(busObjcellOfTimeseries会变暗创建具有维度的结构会变暗.使用此语法创建要加载到总线数组中的结构。

例子

全部折叠

假设您有来自R2016a之前版本中模拟模型的信号日志数据,使用ModelDataLogs格式。日志输出为logsout

查看日志数据。

logsout
logsout = 万博1manbetxSimulink。ModelDataLogs(log_modeldatalogs): Name Elements Simulink Class bus1 2 TsArray

将记录的数据转换为MATLAB的结构timeseries对象。

struct_of_ts =...万博1manbetxSimulink.SimulationData.createStructOfTimeseries (logsout.bus1)
Struct_of_ts = const1-sig: [1x1 timeseries]

创建MATLAB的结构timeseries的对象。万博1manbetx仿真软件。公共汽车对象和部分结构的MATLABtimeseries对象。使用这个结构加载到另一个模型中。打开一个模型进行模拟,产生信号测井数据。

打开一个模型进行模拟,产生信号测井数据。

open_system (docpath (fullfile (docroot,“工具箱”“万博1manbetx模型”...“例子”“ex_log_structTimeSeries”))) sim卡(“ex_log_structTimeSeries”

查看记录的信号数据。

ex_log_structTimeSeries_logsout
万博1manbetx名称BlockPath ____ ____________________________________ 1 [1x1 Signal] bus1 ex_log_structTimeSeries/Bus Creator 2 [1x1 Signal] bus2 ex_log_structTimeSeries/Bus create1 -使用括号{}访问,修改或添加使用索引的元素。

打开模型,将记录的信号数据加载到其中。

open_system (docpath (fullfile (docroot,“工具箱”“万博1manbetx模型”...“例子”“ex_load_structTimeSeries_Bus”)))

ex_load_structTimeSeries_Bus模型配置参数>数据导入/导出>输入参数列出ex_load_structTimeSeries_inputBus变量。但是,您还没有在MATLAB工作区中定义该变量。使用万博1manbetxSimulink.SimulationData.createStructOfTimeseries来定义这个变量。

ex_load_structTimeSeries_inputBus =...万博1manbetxSimulink.SimulationData.createStructOfTimeseries...“公共汽车”ex_log_structTimeSeries_logsout.get (2) . values)
ex_load_structTimeSeries_inputBus = a: [1x1 timeseries] b: [1x1 timeseries]

创建MATLAB的结构timeseries要加载到总线数组中的对象。指定所创建的结构的尺寸和MATLAB的单元格数组timeseries对象。

打开一个模型进行模拟,产生信号测井数据。

open_system (docpath (fullfile (docroot,“工具箱”“万博1manbetx模型”...“例子”“ex_log_structTimeSeries”))) sim卡(“ex_log_structTimeSeries”

模拟ex_log_structTimeseries模型看起来像这样:

查看记录的信号数据。

ex_log_structTimeSeries_logsout
万博1manbetx名称BlockPath ____ ____________________________________ 1 [1x1 Signal] bus1 ex_log_structTimeSeries/Bus Creator 2 [1x1 Signal] bus2 ex_log_structTimeSeries/Bus create1 -使用括号{}访问,修改或添加使用索引的元素。

打开模型,将记录的信号数据加载到其中。

open_system (docpath (fullfile (docroot,“工具箱”“万博1manbetx模型”...“例子”“ex_load_structTimeSeries_AoB”)))

ex_load_structTimeSeries_AoB模型的配置参数>数据导入/导出>输入参数列出ex_load_structTimeSeries_inputAoB变量。但是,您还没有在MATLAB工作区中定义该变量。使用万博1manbetxSimulink.SimulationData.createStructOfTimeseries来定义这个变量。

ex_load_structTimeSeries_inputAoB =...万博1manbetxSimulink.SimulationData.createStructOfTimeseries...“公共汽车”, {ex_log_structTimeSeries_logsout.get .Values.a (1),...ex_log_structTimeSeries_logsout.get .Values.b (1),...ex_log_structTimeSeries_logsout.get (2) .Values.c,...ex_log_structTimeSeries_logsout.get (2) . values。d}, (2, 1))
ex_load_structTimeSeries_inputAoB = 2x1结构数组的字段:a b

输入参数

全部折叠

万博1manbetx仿真软件。TsArray对象转换为MATLAB的结构timeseries对象

在R2016a之前的版本中,当您使用ModelDataLogs格式,记录的数据是一个集合万博1manbetx仿真软件。TsArray对象。

总线对象创建的MATLAB结构timeseries对象的名称指定万博1manbetx仿真软件。公共汽车对象。

数据类型:字符

结构对象,用于值覆盖地面值,指定为MATLAB的结构timeseries对象。该结构必须具有与总线对象相同的层次结构。但是,结构中的字段名称不必与相应总线对象节点的名称相匹配。

数据类型:结构体

单元格数组对象,用于值覆盖地面值,指定为MATLAB的单元格数组timeseries对象。如果你指定一个单元格数组的MATLABtimeseries对象,并指定a会变暗参数,则单元格数组的长度必须等于的结果万博1manbetxSimulink.BusObject.getNumLeafBusElements乘以指定尺寸的乘积。

数据类型:细胞

此函数创建的结构的尺寸,以向量的形式指定。单元格数组的长度等于的结果万博1manbetxSimulink.BusObject.getNumLeafBusElements乘以指定尺寸的乘积。

如果在表单中指定维度[n],然后是Sim万博1manbetxulink®将维度解释为1 xn

数据类型:

输出参数

全部折叠

MATLABtimeseries对象,作为结构返回。的层次结构和属性相同万博1manbetx仿真软件。TsArray对象或万博1manbetx仿真软件。公共汽车对象。

的维度structOfTimeseries取决于输入参数:

  • 如果你指定tsArrayObject,那么维数是1。

  • 如果指定busObj以及MATLAB的结构timeseries,则该尺寸与指定结构的尺寸相匹配。

  • 如果只指定busObj以及MATLAB的单元格数组timeseries,那么维数是1。

  • 如果指定busObj参数,一个单元格数组的MATLABtimeseries,以及会变暗参数,那么维度与的维度匹配会变暗

在R2013a中介绍

这个话题有帮助吗?