加载用于仿真的信号数据
加载用于仿真模型的信号数据
可以使用几种不同的方法将数据加载到模型中,包括:
根级输入端口 - 从工作区导入信号数据,使用输入配置参数将其导入到 Inport、Enable 或 Trigger 模块的根级输入端口。要将多个信号导入到根级输入端口中,请考虑使用根输入端口映射器工具。
From File 模块 - 从 MAT 文件读取数据,将数据输出为信号。
From Spreadsheet 模块 - 从 Microsoft® Excel® 电子表格或 CSV 电子表格读取数据,将数据输出为一个或多个信号。
Playback 模块 - 从工作区、文件或仿真数据检查器加载数据。
信源模块 - 添加一个信源模块(例如 Sine Wave 模块)以生成要输入到另一个模块的信号。
Signal Editor 模块 - 显示、创建、编辑和切换可互换场景。
持久数据 - 将大数据从 MAT 文件流式传输到模型中。
您可以通过文件、工作区变量或模型参数来创建输入信号数据。您可以从另一个信源使用上次仿真时记录的数据,也可以自己创建数据。要确定使用哪种信号加载方法,请参阅Comparison of Signal Loading Techniques。
模块
函数
对象
工具
根输入端口映射器 | Import, visualize, and map signal and bus data to root-level inports |
模型设置
输入 | 使用顶层输入端口加载仿真的外部输入数据的选项 |
主题
信号加载
- 提供用于仿真的信号数据
确定模型的信号数据要求并加载输入信号数据。 - 信号加载方法概述
了解向模型中导入信号数据的可用方法。 - Comparison of Signal Loading Techniques
Determine the signal loading approach that meets your modeling requirements. Often, mapping signal data to root inports works well. - Control How Models Load Input Data
Control how a simulation loads input data using block parameters, model parameters, and different input data formats. - Load Signal Data That Uses Units
Load signal data that uses units from data logged in a previous simulation. Signal logging, the To File block, and the To Workspace block can include units information for Dataset or Timeseries logging formats. - Load Data Logged in Another Simulation
Load signal data into a model that was logged in a previous simulation. - Load Data to Represent Variable-Step Input from Model Hierarchy
Capture dynamics in external input data for a continuous signal by specifying additional time steps for a variable-step solver. - 为基本测试用例加载输入数据
为模型行为的基本测试创建输入数据。
将数据加载到根级输入端口
- 将数据加载到根级输入端口
从工作区加载数据并将其应用于根级输入。 - Load Bus Data to Root-Level Input Ports
Import bus data to top-level input ports by manually specifying the data in the Input configuration parameter or by using the Root Inport Mapper tool. - 使用根输入端口映射器工具映射数据
要将信号和总线数据导入、可视化并映射到根级输入端口,请使用根输入端口映射器工具。 - Map Root Inport Signal Data
Open the Root Inport Mapper Tool and select the map mode. - Create Signal Data for Root Inport Mapping
Create data for root inport mapping using specific guidelines and conventions. - Map Signal Data to Root Input Ports
Map signal data to root input ports by selecting map modes and options and selecting data. Interpret mapping results. - Import Signal Data for Root Inport Mapping
Import signal and bus data for root inport mapping. You can also import test vectors from Simulink® Design Verifier™ environment. - Create and Use Custom Map Modes
Create custom map modes if you do not want to use existing map modes in the Root Inport Mapper tool. - Root Inport Mapping Scenarios
Work with scenarios in the Root Inport Mapper tool. Create and save scenarios, and load previously saved scenarios. - Generate MATLAB Scripts for Simulation with Scenarios
After associating a scenario with the model, generate a MATLAB® script to perform batch simulations.
其他信号加载方法
- Load Input Data for Bus Using In Bus Element Blocks
Load input data for a bus using In Bus Element blocks. - 使用 From Workspace 模块加载数据
使用 From Workspace 模块加载仿真输入数据。 - 使用 From File 模块加载数据
使用 From File 模块创建信号数据并将其保存到 MAT 文件以供加载。 - Load Data Using Playback Block
Load data from the workspace, a file, and the Simulation Data Inspector using the Playback block. - Load Big Data for Simulations
Load big data as simulation input. - Stream Data from a MAT-File as Input for a Parallel Simulation
Stream input data for parallel simulations from a MAT-file. - Load Data with Interchangeable Scenarios
Use Signal Editor block to work with interchangeable scenarios. - Migrate from Signal Builder Block to Signal Editor Block
Consider replacing Signal Builder blocks with Signal Editor blocks.