Main Content

金宝appSimulink函数

Graphically define a function with Simulink blocks

  • 图书馆:
  • Simulink / User-Defined Functions

    SimEvents

  • 金宝appSimulink功能块

Description

金宝appSimulink函数block is a子系统块预先配置作为用Simulink以图形方式定义函数的起点金宝app®blocks. The block provides a text interface to function callers. You can call a金宝appSimulink函数block from aFunction Callerblock, aMATLABFunction块或状态流®chart. See调用一个仿真软金宝app件功能from a Model

有关块参数的说明,请参阅子系统

您可以在金宝app序列查看器。观看者显示何时与参数和返回值进行呼叫。

您可以选择一个金宝appSimulink函数orFunction Caller突出显示与之相关的块。要在打开图或新标签中显示相关块,请在选择后出现的省略号上暂停。然后,选择Related Blocks相关块按钮从动作栏。当多个块对应于所选块时,相关块的列表将打开。您可以通过在文本框中输入搜索词来过滤相关块的列表。从列表中选择一个相关的块后,窗口焦点转到显示相关块的开放图或新选项卡。

Function Interface

这function interface appears on the face of a金宝appSimulink函数堵塞。编辑块文本添加和删除论点INPORTblocks and参数外口从函数定义块。编辑还设置了Function name参数Triggerblock within the金宝appSimulink函数堵塞。

例如,输入y = myfunction(u)面对金宝appSimulink函数block adds one Argument Inport block () and one Argument Outport block (y) within the subsystem.

当使用一个函数调用函数时Function Caller块,参数功能原型in theFunction Caller块必须完全匹配您在金宝appSimulink函数堵塞。This match includes the name of the function and the names of input and output arguments. For example, the金宝appSimulink函数block and theFunction Caller阻止两者使用参数名称一个ndy

When calling a function from a Stateflow transition or state label, you can use different argument names. For example, the金宝appSimulink函数块用途X一个ndy当状态流过渡使用时的论点x2一个ndY2一个rguments to call the function.

功能通话子系统与simulink功能块金宝app

一般来说,功能通话子系统块提供了与直接信号连接更好的信号可追溯性金宝appSimulink函数block, whereas a金宝appSimulink函数block eliminates the need for routing input and output signal lines through the model hierarchy.

属性 功能通行子系统块 金宝appSimulink功能块
Method of executing/invoking function 使用信号线触发 使用函数名称通过引用调用
正式输入参数(论点INPORTblocks) and output arguments (参数外口blocks) No 是的
本地输入(Inport块)和输出(出去port堵塞) 是的 是的

Ports

Input

展开全部

Placing anInport子系统块中的块将外部输入端口添加到金宝appSimulink函数堵塞。端口标签与Inport堵塞。

UseInport块从当地环境中获取信号。

数据类型:单身的|双倍的|一半|int8|int16|int32|INT64|UINT8|你int16|UINT32|Uint64|布尔|fixed point|enumerated|公共汽车|结构

一个论点INPORTblock in a subsystem block provides an input port corresponding to an input argument. A port is not displayed on the subsystem block.

数据类型:单身的|双倍的|一半|int8|int16|int32|INT64|UINT8|你int16|UINT32|Uint64|布尔|fixed point|enumerated|公共汽车|结构

输出

展开全部

Placing an出去port子系统块中的块从块中添加一个输出端口。子系统块上的端口标签是出去port堵塞。

Use出去port块将信号发送到本地环境。

数据类型:单身的|双倍的|一半|int8|int16|int32|INT64|UINT8|你int16|UINT32|Uint64|布尔|fixed point|enumerated|公共汽车|结构

一个参数外口block in a subsystem block provides an output port corresponding to an output argument. A port is not displayed on the subsystem block.

数据类型:单身的|双倍的|一半|int8|int16|int32|INT64|UINT8|你int16|UINT32|Uint64|布尔|fixed point|enumerated|公共汽车|结构

Block Characteristics

数据类型

布尔[[一个这是给予的|公共汽车[[一个这是给予的|双倍的[[一个这是给予的|enumerated[[一个这是给予的|fixed point[[一个这是给予的|一半[[一个这是给予的|integer[[一个这是给予的|单身的[[一个这是给予的|细绳[[一个这是给予的

Direct Feedthrough

no

多维信号

limited[[一个这是给予的

可变大小信号

no

零交叉检测

no

[[一个这是给予的实际数据类型或功能支持取决于块实现。金宝app

扩展功能

Introduced in R2014b