linkTomodel
Link component to model
Description
links from the component to a model or subsystem.modelHandle
= linkToModel(零件
,,,,modelName
)
从组件到由其完整文件名定义的模型或子系统的链接,modelHandle
= linkToModel(零件
,,,,ModelfilEname
)SLX
orSLXP
extension.
Examples
重用组件
保存命名的组件robotComp
in the architecture modelRobot.slx
and reference it from another component namedelectricComp
使组件electricComp
uses the architecture of the componentrobotComp
。
创建模型archModel.slx
。
model = systemcomposer.createmodel(“ ArchModel”,真的);Arch = Get(型号,“建筑学”);
一个dd two components to the model with the nameselectricComp
androbotComp
。
名称= ["electricComp",,,,“ RobotComp”]; comp = addComponent(arch,names);
SaverobotComp
in theRobot.slx
模型因此,组件参考模型。
saveAsModel(comp(2),"Robot");
Link theelectricComp
零件to the same modelRobot.slx
so it uses the architecture of the originalrobotComp
零件and references the architecture modelRobot.slx
。
linkTomodel(comp(1),"Robot");
Clean up the model.
金宝appsimulink.blockdiagram.arangesystem(“ ArchModel”);
Input Arguments
零件
-零件
组件对象
没有子组件的组件,指定为systemcomposer.arch.Component
object.
modelName
-Model or subsystem name
角色向量|细绳
Model or subsystem name for an existing model or subsystem that defines the architecture or behavior of the component, specified as a character vector or string. Models or subsystems of the same name prioritize protected models with theSLXP
extension.
Example:"Robot"
数据类型:char
|细绳
ModelfilEname
-Model or subsystem file name
角色向量|细绳
Model or subsystem file name for an existing model or subsystem that defines the architecture or behavior of the component, specified as a character vector or string.
Example:"Model.slx"
Example:“ preatectedModel.slxp”
数据类型:char
|细绳
输出参数
modelHandle
-Handle to linked model or subsystem
数值
处理链接模型或子系统,作为数字值返回。
数据类型:double
更多关于
定义
学期 | Definition | 一个pplication | 更多信息 |
---|---|---|---|
architecture | 系统作曲家™architecture代表组件系统以及它们如何在结构和行为上相互接口。您可以使用替代视图表示特定的体系结构。 |
不同类型的体系结构描述了系统的不同方面:
|
在视觉上撰写体系结构 |
model | 系统作曲家modelis the file that contains architectural information, including components, ports, connectors, interfaces, and behaviors. |
在模型上执行操作:
系统作曲家模型存储为SLX文件。 |
Create Architecture Model with Interfaces and Requirement Links |
零件 | 一个零件是在体系结构中实现明确功能的系统的一个非平凡,几乎独立且可更换的部分。组件定义了构建元素,例如功能,系统,硬件,软件或其他概念实体。组件也可以是子系统或子函数。 |
组件表示为块,是可以将可重复使用的伪像的体系结构模型的一部分。 |
零件s |
港口 | 一个港口is a node on a component or architecture that represents a point of interaction with its environment. A port permits the flow of information to and from other components or systems. |
There are different types of ports:
|
Ports |
connector | Connectorsare lines that provide connections between ports. Connectors describe how information flows between components or architectures. |
连接器允许两个组件进行交互,而无需定义交互的性质。在端口上设置一个接口以定义组件如何交互。 |
连接 |
学期 | Definition | 一个pplication | 更多信息 |
---|---|---|---|
reference component | 一个reference component是一个组件,其定义是单独的体系结构模型,Simulink金宝app®行为模型或模拟子系统行为。金宝app参考组件代表其他组合物的逻辑层次结构。 |
您可以使用参考组件在模型中重复使用构图。参考组件有三种类型:
|
|
parameter definition | 一个parameter definitionis the definition of a property that has instance semantics. A parameter definition specifies attributes such as name, data type, default value, and units. |
参数定义可以指定为Simulink模型或系统作曲家体系结构模型上的模型参数。金宝app |
访问模型参数作为参考组件上的参数 |
parameter | 一个parameter是参数定义的实例特定值。参数捕获实例特定的值和单位。 |
参数可用于链接到指定模型参数的模型参考或体系结构参考的每个组件。您可以在每个组件上指定一个参数的独立值。 |
使用参数将实例值与组件存储 |
子系统组件 | 一个子系统组件是一个Si金宝appmulink子系统,是父系统作曲家体系结构模型的一部分。 |
一个dd Simulink subsystem behavior to a component to author a subsystem component in System Composer. You cannot synchronize and reuse subsystem components asReference Component块是因为组件是父模型的一部分。 |
|
状态图 | 一个状态图diagram demonstrates the state-dependent behavior of a component throughout its state lifecycle and the events that can trigger a transition between states. |
添加状态流®chart behavior to describe a component using state machines. You cannot synchronize and reuse Stateflow chart behaviors asReference Component块是因为组件是父模型的一部分。 |
版本历史记录
MATLABCommand
您单击了与此MATLAB命令相对应的链接:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。金宝app
Select a Web Site
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
一个mericas
- 一个mérica Latina(Español)
- Canada(English)
- United States(English)