Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

保存仿真的运行时数据

将仿真数据保存到 MATLAB® 工作区;记录信号;导出信号、时间、输出和状态数据

您可以在仿真过程中将信号值保存到 MATLAB 工作区,或保存到 MLDATX 文件、MAT 文件或 Excel®,以便于以后进行检索和后期处理。保存仿真数据也称为记录或导出仿真数据。

Dataset 格式为各种记录方法所记录的结果提供了一种通用的格式,因此以这种方式保存仿真数据可以简化后期处理。可以使用 Dataset 格式将数据存储为 MATLAB timeseries 对象,以便使用 MATLAB 进行处理。

  • 信号记录和数据存储使用 Dataset 格式。

  • 输出和状态记录使用 Dataset 作为默认格式。

  • To File 和 To Workspace 模块的默认保存格式为 Timeseries

Simulink® 提供了转换工具,可以将记录的数据转换为 Dataset 格式

要确定应该使用哪种方法来记录信号数据,请参阅导出仿真数据

模块

Outport为子系统或外部输出创建输出端口
RecordLog data to the workspace, to a file, or both
To File将数据写入到文件
To Workspace将数据从 Simulink 模型记录到工作区

工具

检测属性View and edit logging and visualization properties for logged signal
信号属性View and edit signal properties
仿真数据检查器检查并比较数据和仿真结果,以验证和迭代模型设计

函数

全部展开

Simulink.sdi.markSignalForStreamingTurn logging on or off for a signal
Simulink.sdi.getSignalInputProcessingModeGet value of Input Processing signal property
Simulink.sdi.setSignalInputProcessingModeSpecify value for Input Processing signal property
Simulink.SimulationData.signalLoggingSelectorOpen Signal Logging Selector

配置记录的数据大小限制

Simulink.sdi.setMaxDiskUsageSpecify maximum size for data logged to disk
Simulink.sdi.getMaxDiskUsageGet configured maximum size for data logged to disk
Simulink.sdi.setRequiredFreeSpaceSpecify minimum disk space to leave free when logging data
Simulink.sdi.getRequiredFreeSpaceGet configured minimum disk space requirement for logging
Simulink.sdi.setDeleteRunsOnLowSpaceSpecify behavior when logged data size approaches configured limits
Simulink.sdi.getDeleteRunsOnLowSpaceGet configured behavior when size of logged data approaches configured limits
Simulink.sdi.setRecordDataSpecify record mode for logging
Simulink.sdi.getRecordDataCheck record mode for logging

配置仿真数据检查器存档

Simulink.sdi.setArchiveRunLimitSpecify number of runs to retain in Simulation Data Inspector archive
Simulink.sdi.setAutoArchiveModeSpecify how Simulation Data Inspector manages simulation runs
Simulink.sdi.getArchiveRunLimitGet limit for number of runs to retain in Simulation Data Inspector archive
Simulink.sdi.getAutoArchiveModeGet Simulation Data Inspector run management mode
Simulink.sdi.setStorageLocationSpecify location for logged data on disk
Simulink.sdi.getStorageLocationGet path to custom storage location for data logged to disk
Simulink.sdi.setStorageModeSpecify whether to log data to disk or memory
Simulink.sdi.getStorageModeCheck if logging is configured to log data to disk or memory
Simulink.SimulationData.createStructOfTimeseriesCreate structure of timeseries data to load as simulation input for bus
Simulink.SimulationData.forEachTimeseriesApply function to data contained in set of timeseries objects
Simulink.SimulationData.DatasetRef.getDatasetVariableNamesList names of variables in MAT file that contain Simulink.SimulationData.Dataset objects
getAsDatastoreGet matlab.io.datastore.SimulationDatastore representation of element from referenced Dataset object
Simulink.ModelDataLogs.convertToDataset(Not recommended) Convert data logged using ModelDataLogs format to Dataset format
Simulink.SimulationData.updateDatasetFormatLogging
removeElementRemove element from Simulink.SimulationData.Dataset object

全部展开

Simulink.SimulationOutput访问仿真结果
Simulink.SimulationData.DatasetAccess logged simulation data or group simulation input data
Simulink.SimulationData.SignalContainer for signal logging information
Simulink.SimulationData.DatasetRefCreate Simulink.SimulationData.DatasetRef object
matlab.io.datastore.SimulationDatastoreDatastore for inputs and outputs of Simulink models
Simulink.SimulationData.BlockPathFully specified Simulink block path
Simulink.SimulationData.StateState logging element
Simulink.SimulationData.UnitStore units for simulation data
Simulink.SimulationData.LoggingInfoSignal logging override settings
Simulink.SimulationData.ModelLoggingInfoSignal logging override settings for a model
Simulink.SimulationData.SignalLoggingInfoSignal logging override settings for signal
Simulink.SimulationMetadataAccess metadata of simulation runs

主题

仿真数据

仿真状态

信号记录

数据存储

  • Log Data Stores
    Configure a data store for logging so that you can view the data stored in a simulation run.