主要内容

内存

从前时间步骤的输出输入

  • 库:
  • 金宝appSimulink /离散

    HDL编码器 /离散

  • 内存block

描述

内存block holds and delays its input by one major integration time step. When placed in an iterator subsystem, it holds and delays its input by one iteration. This block accepts continuous and discrete signals. The block accepts one input and generates one output. Each signal can be a scalar, vector, matrix, or N-D array. If the input is non-scalar, the block holds and delays all elements of the input by the same time step.

您使用初始条件范围。仔细选择此参数可以最大程度地减少不需要的输出行为。但是,您无法指定示例时间。该块的示例时间取决于所使用的求解器的类型,或者您可以指定继承它。这继承样本时间参数确定样品时间是继承还是基于求解器。

Tip

当这两个条件都是正确时,请避免使用内存块:

  • 您的模型使用可变步骤求解器ode15s或者ODE113

  • 模拟过程中块的输入变化。

当内存块继承离散的示例时间时,该块类似于单位延迟堵塞。However, the Memory block does not support state logging. If logging the final state is necessary, use a单位延迟取而代之的是。

与类似块的比较

内存,单位延迟, 和Zero-Order Holdblocks provide similar functionality but have different capabilities. Also, the purpose of each block is different.

该表显示了每个块的建议使用。

堵塞 块的目的 Reference Examples
单位延迟 使用您指定的离散示例时间实施延迟。该块以离散的示例时间接受并输出信号。
内存 通过一个主要集成时间步骤实施延迟。理想情况下,该块接受连续(或在次要时间步中固定)信号,并输出一个固定在次要时间步长的信号。
Zero-Order Hold Convert an input signal with a continuous sample time to an output signal with a discrete sample time.

每个块具有以下功能。

能力 内存 单位延迟 Zero-Order Hold
Specification of initial condition 是的 是的 不, because the block output at time t = 0 must match the input value.
样品时间的规格 不,因为该块只能从驾驶块或用于整个模型的求解器继承样品时间。 是的 是的
金宝app支持基于框架的信号 是的 是的
金宝app支持状态记录 是的

巴士支持金宝app

内存block is a bus-capable block. The input can be a virtual or nonvirtual bus signal subject to the following restrictions:

  • 初始条件must be zero, a nonzero scalar, or a finite numeric structure.

  • 如果初始条件is zero or a structure, and you specify a状态名称,输入不能是虚拟总线。

  • 如果初始条件is a nonzero scalar, you cannot specify a状态名称

For information about specifying an initial condition structure, seeSpecify Initial Conditions for Bus Elements

All signals in a nonvirtual bus input to a内存block must have the same sample time, even if the elements of the associated bus object specify inherited sample times. You can use a费率转换封锁以更改单个信号的样本时间或总线中的所有信号的屏蔽时间。看Modify Sample Times for Nonvirtual Buses具有公共汽车的块了解更多信息。

You can use an array of buses as an input signal to a内存堵塞。您可以指定初始条件parameter with:

  • 价值0。In this case, all the individual signals in the array of buses use the initial value0

  • 一系列结构,指定总线数组中每个单个信号的初始条件。

  • 单个标量结构为总线类型定义的每个元素指定初始条件。使用此技术为阵列中的每个总线指定相同的初始条件。

有关定义和使用一系列公共汽车的详细信息,请参阅在公共汽车阵列中的集体非虚拟巴士

端口

输入

展开全部

输入signal, specified as a scalar, vector, matrix, or N-D array. The input can be continuous or discrete, containing real, or complex values of any data type Simulink®金宝app支持。

数据类型:single|双倍的|int8|INT16|INT32|INT64|UINT8|UINT16|uint32|uint64|布尔|固定点|枚举|bus

Output

展开全部

输出是前一个时间步骤的输入。

数据类型:single|双倍的|int8|INT16|INT32|INT64|UINT8|UINT16|uint32|uint64|布尔|固定点|枚举|bus

Parameters

展开全部

主要的

在初始集成步骤中指定输出。当您不使用内置输入数据类型时,此值必须为0。

Programmatic Use

块参数:初始条件
类型:角色向量
Values:标量|向量
Default:'0'

Select to inherit the sample time from the driving block:

  • 如果驾驶块具有离散的样本时间,则该块继承了样本时间。

  • 如果the driving block has a continuous sample time, selecting this check box has no effect. The sample time depends on the type of solver used for simulating the model.

When this check box is cleared, the block sample time depends on the type of solver used for simulating the model:

  • 如果求解器是可变步骤求解器,则块样品时间是连续的,但在较小的时间步中固定:[0,1]

  • 如果求解器是固定步骤求解器,则[0,1]sample time converts to the solver step size after sample-time propagation.

Programmatic Use

块参数:sashitsampletime
类型:角色向量
Values:'离开'| 'on'
Default:'离开'

Select to output the input during linearization and trim. This selection sets the block mode to direct feedthrough.

Selecting this check box can cause a change in the ordering of states in the model when using the functionslinmod,dlinmod, ortrim。To extract this new state ordering, use the following commands.

首先使用以下命令编译模型,其中模型是Simulink模型的名称。金宝app

[尺寸,x0,x_str] =模型([],[],[],'lincompile');

接下来,使用此命令终止汇编。

模型([],[],[],'term');

输出参数,x_str,这是Simulink模型中状态的单元格数组,其中包含新的状态排序。金宝app当通过状态向量作为输入时linmod,dlinmod, ortrimfunctions, the state vector must use this new state ordering.

Programmatic Use

块参数:线性学历
类型:角色向量
Values:'离开'| 'on'
Default:'离开'

选择线性化内存内存块由具有离散样品时间的信号驱动。

Programmatic Use

块参数:线性化
类型:角色向量
Values:'离开'| 'on'
Default:'离开'

State Attributes

使用此参数将唯一名称分配给块状态。默认值为' '。当此字段为空白时,未分配名称。使用此参数时,请记住以下注意事项:

  • 有效的标识符从字母或下划线字符开始,其次是字母数字或下划线字符。

  • 状态名称仅适用于所选块。

This parameter enables状态名称must resolve to Simulink signal object当您单击时Apply

有关更多信息,请参阅C Code Generation Configuration for Model Interface Elements(Simulink Coder)

Programmatic Use

块参数:Statename
类型:角色向量
Values:唯一名称
Default:''

选择此复选框以要​​求状态名称解析为Simulink信号对象。金宝app

Dependencies

要启用此参数,请指定一个值状态名称。This parameter appears only if you set the model configuration parameter信号分辨率to a value other than没有任何

Programmatic Use

块参数:statemustresolvetosignalObject
类型:角色向量
Values:'离开'| 'on'
Default:'离开'

块特征

Data Types

布尔|bus|双倍的|枚举|固定点|整数|single

直接进料

是的

多维信号

是的

可变大小信号

零交叉检测

扩展功能

C/C ++代码生成
使用Simulink®Coder™生成C和C ++代码。金宝app

PLC Code Generation
使用Simulink®PLCCoder™生成结构化文本代码。金宝app

定点转换
使用定点Designer™设计和模拟定点系统。

Version History

在R2006a之前引入