主要内容

从工作区

从工作区负载信号数据

  • 图书馆:
  • SIMulink / Sources

  • 从工作区块

Description

从工作区Block从工作区读取信号数据,并以其输出为信号提供数据。

这block displays the expression specified in the数据范围。有关如何评估表达方式的详细信息,请参见符号分辨率

You can specify how the data is loaded, including sample time, how to handle data for missing data points, and whether to use zero-crossing detection. For more information, see使用从工作区块加载数据

笔记

金宝app®CODER™连接到该块的软件不会生成该块的代码SIMport under the conditions listed in环境控制器

Specifying Workspace Data

在里面从工作区block dialog box, use the数据parameter to specify the workspace data to load. You can specify a MATLAB®表达式(例如,MATLAB工作区中变量的名称)评估以下一个选项之一:

  • 一个timeseries目的

  • 一个结构timeseries对象

  • 一个timetable目的

  • 一个结构timetable对象

  • 有或没有时间的结构

  • 二维矩阵

有关其他信息,请参阅使用从工作区块加载数据

笔记

When you specifytimetable加载的数据,每个timetable对象只能包含一个信号的数据。

Use with Data Dictionary

When you link a model to a data dictionary, you:

  • Store design data, which contributes to the fundamental design of the model in the Design Data section of the dictionary. Design data includes numeric variables and金宝appsimulink.parameter对象that you use to set block parameter values.

  • 在基本工作区中,存储模拟输入数据,用于刺激和实验模型。通常,您将模拟输入数据作为MATLAB创建timeseries对象。

为了more information about storing variables, objects, and other data that a model uses, see确定在何处存储simulink模型的变量和对象金宝app

  • 使用一个从工作区块,将目标变量存储在字典的设计数据部分中,并设置数据parameter of the block to the name of the variable.

  • 要访问仿真输入数据,请将目标变量存储在基本工作区中,并设置数据parameter by using a call to the评估功能。在电话中评估, specify thews论点为'根据'so that the block seeks the variable in the base workspace instead of the data dictionary. For example, if the name of the variable ismytimeseriesObject, 放数据to评估(“基础”,“ mytimeseriesObject')

Ports

输出

expand all

Signal created from workspace data. The block can generate real or complex signals of any type that Simulink supports, including fixed-point and enumerated data types.

数据Types:single|double|一半|int8|INT16|int32|int64|uint8|uint16|uint32|uint64|Boolean|固定点|枚举|bus

参数

expand all

在里面数据parameter, specify the workspace data to load. Specify a MATLAB expression (for example, the name of a variable in the MATLAB workspace) that evaluates to one of the following:

  • 一个timeseries目的

  • 一个结构timeseries对象

  • 一个timetable目的

  • 一个结构timetable对象

  • 有或没有时间的结构

  • 二维矩阵

从工作区块还接受总线对象作为数据类型。要加载总线数据,请使用timeseries或者timetable对象。为了details, see将总线数据加载到根级输入端口

Real signals of typedouble可以是任何数据格式从工作区块支持。金宝app对于复杂的信号和数据类型的真实信号double,使用任何格式除外大批

有关其他信息,请参阅指定工作区数据

笔记

When you specifytimetable加载的数据,每个timetable对象只能包含一个信号的数据。

程序化使用

块参数:变量的名称
类型:character vector
Values:timeseries对象|结构timeseries对象|结构|2-D矩阵
默认:'simin'

需要的数据类型的工作空间数据从工作区块负载。对于非BUS类型,要跳过任何数据类型验证,您可以使用继承:自动。为了more information, seeControl Signal Data Types

要加载总线数据,请使用timeseries或者timetable对象。为了details, see将总线数据加载到根级输入端口

程序化使用

块参数:OutDataTypeStr
类型:character vector
Values:“继承:自动”|'double' | 'single' | 'half' | 'int8' | 'uint8' | 'int16' | 'uint16' | 'int32' | 'uint32' | 'int64' | 'uint64' | 'boolean' | 'fixdt(1,16,0)' | 'fixdt(1,16,2^0,0)' | 'Enum: ' | 'Bus: ' | ''
默认:“继承:自动”

Sample rate of loaded workspace data. For details, seeSpecify Sample Time

程序化使用

块参数:采样时间
类型:character vector
Values:标量|vector
默认:'0'

当您选择此选项,块执行near interpolation at time hits for which no corresponding workspace data exist. Otherwise, the current output equals the output at the most recent time for which data exists.

从工作区通过使用两个相应的工作空间样本来阻止插值:

  • 为了doubledata, linearly interpolates the value by using the two corresponding samples

  • 为了Boolean数据,用途错误的在两个时间值之间的上半部分和真的下半年

  • 对于内置数据类型以外的其他数据类型double或者Boolean

    • 将数据提升到double

    • Performs linear interpolation (as described fordouble数据)

    • 将插值值降低到原始数据类型

您不能使用枚举的线性插值(枚举) data.

该块将最后一个已知数据点的值用作最后已知数据点后发生的时间命中的值。

To determine the block output after the last time hit for which workspace data is available, combine the settings of these parameters:

  • Interpolate data

  • 为了m output after final data value by

有关详细信息,请参阅为了m output after final data value by范围。

程序化使用

块参数:Interpolate
类型:character vector
Values:'off' | 'on'
默认:'上'

当您选择时Enable zero-crossing detection,并且输入阵列在同一时间中包含多个条目,Simulink检测到零交叉。金宝app例如,假设输入数组具有此数据。

time: 0 1 2 2 3 signal: 2 3 4 5 6

一个t time 2, there is a zero crossing from input signal discontinuity. For more information, see零交叉检测

对于总线信号,Simulink检测金宝app到所有叶子总线元件的零交叉口。

程序化使用

块参数:Zerocross
类型:character vector
Values:'off' | 'on'
默认:'上'

从工作区块使用Interpolate data为了m output after final data value bysettings to determine the block output after the last sample available in the workspace data.

This table lists the block output, based on the values of the two options.

最终数据值之后的表单输出设置 Setting for Interpolate Data 最终数据后的块输出

外推

On

从最终数据值推断

离开

错误

设置为零

On

Zero

离开

Holding final value

On

Final value from workspace

离开

循环重复

On

错误

离开

Repeated from workspace if the workspace data is in structure-without-time format. Error otherwise.

为了example, when you enableInterpolate data和set为了m output after final data value byto外推, the block uses the last two data points in the workspace data to extrapolate values for subsequent data points.

为了example, consider this model. The从工作区块读取通过记录输出创建的工作空间数据Sine Waveblock for a 16-second simulation. The仪表板范围blocks display theSine Wave块输出和从工作区20秒模拟的块输出。模拟达到16秒后,从工作区block output diverges from theSine Wave块输出作为从工作区块线性地推断了其余模拟的值。

程序化使用

块参数:outputafterfinalValue
类型:character vector
Values:“外推”|'Setting to zero' | 'Holding final value' | 'Cyclic repetition'
默认:“外推”

块特征

数据Types

Boolean|bus|double|枚举|固定点[[一个这是给予的|一半|整数|single|string

直接进料

Multidimensional Signals

yes

Variable-Size Signals

yes

零交叉检测

yes

[[一个这是给予的金宝app通过使用定点设计器创建的FI对象支持输入。

Extended Capabilities

在R2006a之前引入