Main Content

Simulink.sdi.DiffRunResult.getLatest

R2026b

Access results from most recent comparison

Description

diffRes = Simulink.sdi.DiffRunResult.getLatest returns the Simulink.sdi.DiffRunResult object diffRes for the most recent comparison performed using the Simulation Data Inspector UI or programmatic interface.

Tip

When you compare data using the Simulation Data Inspector UI, results are not returned in the workspace. You can use the Simulink.sdi.DiffRunResult.getLatest function to access results for comparisons performed using the Simulation Data Inspector UI. When you compare data using the Simulink.sdi.compareRuns or Simulink.sdi.compareSignals functions, the function returns the data in a Simulink.sdi.DiffRunResult object or a Simulink.sdi.DiffSignalResult object.

example

Examples

collapse all

Use the Simulink.sdi.DiffRunResult.getLatest function to access the results of the most recent comparison to save or process further. For more information about how to compare data using the Simulation Data Inspector UI, see Compare Simulation Data.

compResults = Simulink.sdi.DiffRunResult.getLatest;

Recover comparison results after deleting the workspace variable storing the results.

Compare two runs.

myDiffResult = Simulink.sdi.compareRuns(myRunID1,myRunID2);

Delete the variable storing the results, and then recover the results.

clear myDiffResult
myDiffResult = Simulink.sdi.DiffRunResult.getLatest;

Output Arguments

collapse all

Results of the most recent comparison, returned as a Simulink.sdi.DiffRunResult object.

Version History

Introduced in R2020a