主要内容

getAsDatastore

类:金宝appSimulink.SimulationData.DatasetRef
包:金宝app仿真软件。SimulationData

从引用的Dataset对象中获取元素的matlab.io.datastore.SimulationDatastore表示

语法

元素= Simuli金宝appnk.SimulationData.DatasetRef.getAsDatastore (datasetref_elements)

描述

元素= Simuli金宝appnk.SimulationData.DatasetRef.getAsDatastore (datasetref_elements)返回一个matlab.io.datastore.SimulationDatastore基于索引、名称或元素块路径的引用数据集中的元素或元素集合的表示。

你可以表示数据集元素作为matlab.io.datastore.SimulationDatastore如果使用以下两种方法之一将元素放入MAT-file中:

  • 日志数据集格式化数据到持久存储(mat文件)。

  • 将元素放入a中金宝appSimulink.SimulationData.Dataset对象,并保存数据集对象到v7.3 mat文件中。

SimulationDatastore表示为一个数据集元素为该元素的Values字段创建一个SimulationDatastore对象。的SimulationDatastore的表示支持数据流金宝app将该元件的性质引入其他仿真或MATLAB中®

请注意

不能使用createSimulationDatastore数据集包含这些类型数据的元素:

  • 数组

您可以使用SimulationDatastore对象:

  • 请参阅以mat文件的形式存储在磁盘上的日志模拟数据。

  • 指定从磁盘递增流到模拟的信号。

  • 为使用MATLAB函数进行大数据分析提供了基础。

输入参数

全部展开

元素,指定为索引、名称(作为字符向量)或块路径(作为字符向量)。

输出参数

全部展开

元素访问使用SimulationDatastore对象,返回为matlab.io.datastore.SimulationDatastore对象或一个金宝app仿真软件。信号金宝app仿真软件。状态,或类似的物体数据使用一个matlab.io.datastore.SimulationDatastore对象。

例子

全部展开

将信号数据记录到持久存储(选择Log数据集到文件配置参数),并对模型进行仿真。

创建一个DatasetRef用于信号测井数据集数据(logsout)out.matMAT-file。

sigLogRef = 金宝appSimulink.SimulationData.DatasetRef (“out.mat”“logsout”);firstSig = sigLogRef.getAsDatastore (1)
Simulink. s金宝appimulationdata . signal Package: Simulink。SimulationDataProperties: Name: 'x1' PropagatedName: '' BlockPath: [1x1 Simulink.SimulationData.BlockPath] PortType: 'outport' PortIndex: 1 Values: [1×1 matlab.io.datastore.SimulationDatastore]

将数据加载到另一个模型中。这种方法将信号的值流化x1另一个模拟。

ds = 金宝appSimulink.SimulationData.Dataset;ds {1} = sigLogRef {1};sim卡(“other_model”“ExternalInput”“死刑”);

替代

为了简化索引的使用,可以使用花括号({})语法来获取SimulationDatastore对象DatasetRef对象的信号值。要求和结果与使用相同getAsDatastore.例如,如果将信号数据记录到持久存储(选择Log数据集到文件配置参数),并对模型进行仿真。

sigLogRef = 金宝appSimulink.SimulationData.DatasetRef (“out.mat”“logsout”);firstSig = sigLogRef {1}
ans = 金宝appSimulink. simulationdata . signal Package: Simulink。SimulationDataProperties: Name: 'x1' PropagatedName: '' BlockPath: [1x1 Simulink.SimulationData.BlockPath] PortType: 'outport' PortIndex: 1 Values: [1×1 matlab.io.datastore.SimulationDatastore]
介绍了R2017a