Simulink.ModelReference.ProtectedModel.setPasswordForSimulation - Add or provide encryption password for simulation of protected
model - MATLAB (original) (raw)
Main Content
Add or provide encryption password for simulation of protected model
Syntax
Description
Simulink.ModelReference.ProtectedModel.setPasswordForSimulation([model](#buikwdt-model),[password](#buikwdt-password))
adds an encryption password for simulation if you create a protected model. If you use a protected model, the function provides the required password to simulate the model.
Examples
Create a protected model with encryption for simulation.
openExample('sldemo_mdlref_counter'); Simulink.ModelReference.ProtectedModel.setPasswordForSimulation(... 'sldemo_mdlref_counter','password'); Simulink.ModelReference.protect('sldemo_mdlref_counter',... 'Encrypt',true,'Report',true);
A protected model named sldemo_mdlref_counter.slxp
is created that requires an encryption password for simulation.
Use a protected model with encryption for simulation.
Provide the encryption password required for simulation of the protected model.
openExample('sldemo_mdlref_counter'); Simulink.ModelReference.ProtectedModel.setPasswordForSimulation(... 'sldemo_mdlref_counter','password');
After you have provided the encryption password, you can simulate the protected model.
Input Arguments
Model name, specified as a string or character vector. It contains the name of a model or the path name of a Model block that references the protected model.
Password, specified as a string or character vector. If the protected model is encrypted for simulation, the password is required.
Version History
Introduced in R2014b