Can I generate a protected model with a different name to the base model

2 次查看(过去 30 天)
I am using the Simulink.ModelReference.protect function for generating protected models. My model depends on a global variable 'NumberOfVehicles' for vector sizing, however this is burnt into the model when generating the protected model. I would therefore like to be able to generate a few different versions of the protected model, all generated from the same base model, having different settings for NumberOfVehicles. E.g. I have MyModel.slx, and I want to be able to generate;
MyModel_50Vehicles.slxp
MyModel_100Vehicles.slxp
MyModel_200Vehicles.slxp
However, the Simulink.ModelReference.protect only accepts the name of the model it's generating from and generates the protected model with the same name. Is there a nice* way of calling Simulink.ModelReference.protect such that I can independently set the name of the generated protected model?
*Clearly I could copy the base model with a new name for each model that I want to generate, but that does seem a little messy.

回答(1 个)

Jesús Zambrano
Jesús Zambrano 2020-2-6
Hi Rohan,
each of them with the specific version of your model, and then create the protected version of all of them. I´m afraid you cannot change the name when creating a protected model.

类别

Help CenterFile Exchange 中查找有关 Subsystems 的更多信息

产品


版本

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by