Main Content

Data Logging

Log data to workspace during model simulation for subsequent data processing

You can log simulation data to the workspace, or to a temporary file on disk, for debugging and verification. Data logging lets you analyze how internal block variables change with time during simulation. For example, you might want to see that the pressure in a hydraulic cylinder is above some minimum value or compare it against the pump pressure. If you log simulation data, you can later query, plot, and analyze it without rerunning the simulation.

Simscape™ Results Explorer is an interactive tool that lets you navigate and plot the simulation data logging results. You can use data logging and the Simscape Results Explorer to view simulation results, instead of adding sensors and scopes to your model. For more information, see Log, Navigate, and Plot Simulation Data.

Simscape data logging lets you log data for the whole model or log all of the variables for selected blocks. Alternatively, you can add instrumentation to Simscape blocks by selecting individual variables to log in a Simulink.SimulationOutput object, along with Simulink® variables and signals. For more information, see About Selective Logging.


Simscape Results ExplorerNavigate and plot simulation data logging results


espandi tutto

simscape.logging.NodeHierarchy tree for simulation data
simscape.logging.SeriesTime-value series for simulation data
simscape.logging.exportSave logged simulation data in MLDATX file
simscape.logging.importCreate simulation log variable to access data in MLDATX file
simscape.logging.plotPlot logged simulation data for Node or Series
simscape.logging.plotxyPlot logged simulation data for one node or series against another
simscape.logging.findNodeFind Node object corresponding to block or subsystem (Da R2020a)
simscape.logging.sli.findNode(To be removed) Find Node object corresponding to block or subsystem
simscape.logging.findPathFind path to node in logged simulation data tree (Da R2020a)
simscape.logging.sli.findPath(To be removed) Find path to node in logged simulation data tree
simscape.logging.getSimulationLogIdentify latest Simscape simulation log for a model (Da R2024a)
simscape.logging.timestampDetermine whether simulation log is current or stale (Da R2021a)
sscexploreOpen Simscape Results Explorer to interact with logged simulation data
sscprintzcsPrint zero crossing information for logged simulation data
simscape.instrumentation.enableLoggingEnable logging for block (Da R2024a)
simscape.instrumentation.disableLoggingDisable logging for block (Da R2024a)
simscape.instrumentation.isLoggingEnabledReturns whether logging is enabled for a block (Da R2024a)


Simscape Data Logging

Selective Logging