Main Content

sldvchecksum

Returns checksum of model

Since R2021a

Description

checksum = sldvchecksum(model) returns the checksum of the model passed as the input argument. The checksum represents the state of the model being analyzed.

checksum = sldvchecksum(system) returns the checksum for the specified component system. The component system must be an atomic subsystem or a Model block.

Examples

collapse all

You can compute the checksum of model and compare it with an updated model checksum. You can also compare the checksum of a model with the checksum provided in the Simulink® Design Verifier™ analysis report.

Compare this checksum with the checksum in the Simulink Design Verifier analysis report by using:

openExample('sldv/CruiseControlTestGenerationExample',...
'supportingFile', 'sldvdemo_cruise_control')
[checksum] = sldvchecksum('sldvdemo_cruise_control');

Open the same sldvdemo_cruise_control model and make changes to it. Save the updated model. Repeat the previous step to calculate the checksum, then compare the checksums of the original model and the updated model.

Input Arguments

collapse all

Handle to a Simulink model, specified as a character vector or string scalar.

Example: sldvdemo_cruise_control

Handle to an atomic subsystem or Model block in a Simulink model, specified as a character vector or string scalar.

Output Arguments

collapse all

128-bit checksum of the model, returned as a character vector.

Tips

Any modification to the model that alters the simulation outcome impacts the checksum. For more information on when the checksum of the model changes, see Tip in Simulink.BlockDiagram.getChecksum.

Additionally, the checksum of a model in Simulink Design Verifier changes, if:

  • The value of any parameter in the model changes.

  • The minimum and maximum values specified on the input ports changes.

The checksum of a model does not change if:

  • The model contains MATLAB System blocks and you modify the source code of the System object™ to which the MATLAB System blocks refer.

  • You modify the custom block replacement rules for the model.

Note

The checksum of a single model may not match in different MATLAB® versions due to internal changes.

Version History

Introduced in R2021a