在仿真期间查看数据
在 Simulink® 中使用示波器和查看器在仿真期间可视化和测量信号,以调试模型并验证设计。您可以将信号连接到 Scope 模块,或将 Floating Scope and Scope Viewer 添加到模型中而不连接信号线。使用仿真结果验证设计并进行迭代。要了解详细信息,请参阅Prototype and Debug Models with Scopes。
示波器中的测量设置使您能够测量在示波器窗口中显示的信号的各个方面。例如,您可以使用游标测量信号值、计算信号统计量、查找峰值、显示双电平测量(如信号转换、过冲、下冲和周期),甚至设置触发器来同步重复信号并在发生特定事件时暂停显示画面。
示波器容器使您能够将 Simulink 模型的多个示波器停靠到单个窗口中。该容器提供便捷的界面,您可以从中可视化信号并管理示波器的设置。
您也可以查看仿真数据并使用 Record 模块将其记录到工作区、文件或同时记录到两者。使用仿真数据检查器,您可以检查和比较数据及仿真结果,从而验证模型设计并进行迭代。

模块
Scope | 显示仿真过程中生成的信号 |
Floating Scope and Scope Viewer | 显示仿真过程中生成的信号,无信号线 |
Record | View and log data to the workspace, a file, or both (自 R2021a 起) |
对象
TimeScopeConfiguration | 控制 Scope 模块的外观和行为 |
工具
仿真数据检查器 | 检查并比较数据和仿真结果,以验证和迭代模型设计 |
主题
- 决定如何可视化仿真数据
为每个建模和仿真任务选择正确的可视化方法。
- 常见的示波器模块任务
常见示波器任务的逐步过程,这些任务包括记录数据、共享示波器图像和显示画面操作。
- View Values of Parameters Set as Variables
Evaluate parameters defined as variables or variable expressions while editing a model and during simulation.
- Floating Scope 和波形查看器任务
执行常见的 Floating Scope 模块和波形查看器任务时的分步操作。
- 通过编程控制 Scope 模块
此示例显示如何使用编程脚本控制范围。
- Sample Time with Scope Blocks
Understand sample time inheritance when using the Scope and Time Scope blocks.
- Scope 模块和波形查看器概述
有关如何以图形方式显示仿真结果的选项。
- Prototype and Debug Models with Scopes
Prototype and debug models by using scopes and scope measurements.
- Viewers and Generators Manager
Generate and visualize signals without blocks.
- Generate Signals Without Source Blocks
Step-by-step procedures for attaching, modifying, and removing signal generators.
- View Streaming Data in the Simulation Data Inspector
Control the time axis, display scaling, and display offset while data is streaming in the Simulation Data Inspector.
- Control Display of Streaming Data Using Triggers
Use triggers in the Simulation Data Inspector to control when plot displays update to display new data.
- Access Data in MATLAB Function During Simulation
Stream signal data to a MATLAB® callback function during simulation for processing and visualization.