合成信号
使用合成信号(例如总线)对信号进行分组并降低模型的复杂度
为了简化模型外观,可以使用以下方法将各信号组合为合成信号:
虚拟总线
非虚拟总线
复路信号
串联信号
有关合成信号的详细比较,请参阅合成信号的类型。
使用虚拟总线可满足建模时将信号合并为合成信号的大部分要求,并可灵活地合并不同类型的信号。
模块
函数
工具
主题
合成信号基础知识
- 合成信号的类型
通过将信号合并为一个合成信号,降低模型中的外观复杂度。 - Bus-Capable Blocks
Identify the blocks that support virtual buses, nonvirtual buses, and arrays of buses.
以可视化方式对信号线分组
- 将信号线组合为虚拟总线
将信号组合为虚拟总线,这只会影响视觉外观。 - Simplify Subsystem and Model Interfaces with Bus Element Ports
Group multiple lines into a bus at the input or output of a model component. - Display Bus Information
Display information about buses, such as signal hierarchy and whether the bus is virtual or nonvirtual. - Identify Automatic Bus Conversions
Recognize modeling patterns that cause hidden Bus To Vector and Signal Conversion blocks.
修改和配置总线
- Modify Bus Hierarchy
Change the order and hierarchy of nested buses and their elements. - Assign Signal Values to Bus Elements
Use a Bus Assignment block to replace signals assigned to bus elements. - 指定总线元素的初始条件
指定总线元素值作为总线的初始条件。 - Share and Reuse Bus-Routing Blocks
Share blocks that create or interact with buses using subsystem references or custom libraries.
定义总线对象数据类型
- 使用 Simulink.Bus 对象数据类型指定总线属性
了解Simulink.Bus
对象的用法和实现。 - 以编程方式创建总线对象
使用函数和类来定义Bus
对象和总线元素、基于模块创建Bus
对象,或者基于 MATLAB® 数据创建总线对象。
按功能对信号线分组
- Create Nonvirtual Buses
Create buses that appear in generated code and support modeling constructs such as arrays of buses. - Modify Sample Times for Nonvirtual Buses
Make the sample time of signals the same so that you can group them in a nonvirtual bus. - Generate Code for Nonvirtual Buses
Use a structure in code generation to represent a nonvirtual bus. Control data types of initial condition structure fields. - Inspect Generated Code for Nonvirtual Buses
Find nonvirtual buses in generated code for a simple model.
简化迭代处理
- 使用总线数组组合非虚拟总线
通过将具有相同数据类型的非虚拟总线合并为一个数组来简化模型以进行迭代处理。 - 使用总线数组
设置模型以使用总线数组来选择信号、为信号赋值、执行迭代处理、记录和加载信号以及初始化信号。 - Iteratively Process Nonvirtual Buses with Arrays of Buses
Update a model to use arrays of buses to apply the same algorithm to multiple nonvirtual buses with the same data type.