主要内容

在模拟数据检查器中查看数据

您可以使用仿真数据检查器可视化整个设计过程中生成的数据。您登录Simulink的仿真数据金宝app®model logs to the Simulation Data inspector. You can also import test data and other recorded data into the Simulation Data Inspector to inspect and analyze it alongside the logged simulation data. The Simulation Data Inspector offers several types of plots, which allow you to easily create complex visualizations of your data.

查看记录的数据

已记录信号以及输出和状态使用数据集format automatically log to the Simulation Data Inspector when you simulate a model. You can also record other kinds of simulation data so the data appears in the Simulation Data Inspector at the end of the simulation. To see states and output data logged using a format other than数据集在“仿真数据检查器”中,打开“配置参数”对话框,然后在数据导入/导出pane, select theRecord logged workspace data in Simulation Data Inspectorparameter.

Note

When you log states and outputs using the结构或者大批format, you must also log time for the data to record to the Simulation Data Inspector.

模拟数据检查器在表中显示可用数据Inspectpane. To plot a signal, select the check box next to the signal. You can modify the layout and add different visualizations to analyze the simulation data. For more information, seeCreate Plots Using the Simulation Data Inspector

模拟数据检查器使用存档管理传入的仿真数据。默认情况下,当您启动新的模拟时,先前的运行将移至档案。您可以从档案中绘制信号,也可以将有趣的运行拖回工作区域。

Import Data from the Workspace or a File

您可以从基本工作区或文件中导入数据,以自行或与模拟数据一起查看。仿真数据检查器支持所有内置数据类型和许多数据格式,用于从工作金宝app空间导入数据。通常,无论格式如何,都必须将样品值与样品时间配对。在通过导入的工作空间数据创建的运行中,模拟数据检查器允许每个信号最多8000个频道。

You can also import data from these types of files:

  • MAT file

  • CSV文件 - 格式数据如图所示将数据从CSV文件导入仿真数据检查器

  • 微软®Excel®文件 - 格式数据如下所述Microsoft Excel导入,导出和记录格式

  • MDF file — MDF file import is supported for Linux®和Windows®operating systems. The MDF file must have a。mdf,。mf4,。mf3,。data, or。datfile extension and contain data with only integer and floating data types.

  • ULG文件 - 飞行日志数据导入需要一个UAV Toolboxlicense.

要从工作空间或以模拟数据检查器不支持的数据或文件格式保存的文件导入数据,您可以编写自己的工作区数据或文件读取器,以使用金宝appio.readerclass. You can also write a custom reader to use instead of the built-in reader for supported file types. For examples, see:

要导入数据,请选择Importbutton in the Simulation Data Inspector.

在“导入”对话框中,您可以选择从工作区或文件中导入数据。下表显示了可用于导入的数据。如果您在表中没有看到工作区变量或文件内容,则意味着模拟数据检查器没有支持该数据的内置或注册读取器。金宝app您可以使用复选框选择要导入的数据,也可以选择是否将该数据导入现有运行还是新运行。

When you import data into a new run, the run always appears in the work area. You can manually move imported runs to the archive.

View Complex Data

To view complex data in the Simulation Data Inspector, import the data or log the signals to the Simulation Data Inspector. You can control how to visualize the complex signal using theProperties模拟数据检查器中的窗格和Instrumentation Properties对于模型中的信号。访问Instrumentation Propertiesfor a signal, right-click the logging badge for the signal and selectProperties

您可以指定Complex Format作为大小,幅度,相或现实疑问。如果您选择幅度级相位或真实疑问Complex Format, the Simulation Data Inspector plots both components of the signal when you select the check box for the signal. For signals in Real-Imaginary format, the线颜色specifies the color of the real component of the signal, and the imaginary component is a different shade of the线颜色。例如,Rectangular QAM Modular Basebandsignal on the lower graph displays the real component of the signal in light blue, matching the线颜色parameter, and the imaginary component is shown in a darker shade of blue.

对于大小相格式的信号,线颜色specifies the color of the magnitude component, and the phase is displayed in a different shade of the线颜色

字符串数据视图

您可以在模拟数据检查器中使用信号数据记录并查看字符串数据。例如,考虑这个简单的模型。正弦波块的值控制开关是否发送字符串读数Positive或者Negativeto the output.

该图显示了模拟模型的结果。字符串信号显示在图形查看区域的底部。信号的值显示在频段内,并用纵横交错的线标记字符串信号值中的过渡。

You can use cursors to inspect how the string signal values correspond with the sine signal's values.

当您在图上绘制多个字符串信号时,信号堆叠以模拟或导入它们的顺序,最新信号位于顶部。例如,您可以考虑更改控制开关的正弦波相位的效果。

View Frame-Based Data

Processing data in frames rather than point by point provides a performance boost needed in some applications. To view frame-based data in the Simulation Data Inspector, you have to specify that the signal is frame-based in theInstrumentation Propertiesfor the signal. To access theInstrumentation Propertiesdialog for a signal, right-click the signal's logging badge and selectProperties。To specify a signal as frame-based, selectColumns as channels (frame based)for输入处理

View Event-Based Data

您可以将事件数据记录到仿真数据检查器。要查看基于事件的记录数据,请选择旁边的复选框Send: 1。仿真数据检查器将数据显示为词干图,每个词干代表给定样品时间发生的事件数量。

相关话题