Create Simscape protected or pre-compiled model for users who don't have Simscape licenses
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I created a Simulink model (Model.slx) containing Simscape blocs. I need to share with some people for compilation purposes who does not have Simscape licenses.
I could create a script to protect the Simulink model:
Simulink.ModelReference.protect('Model.slx', ...
'Path', 'C:\MyFolder', ...
'Report', true, ...
'Mode', 'CodeGeneration', ...
'CodeInterface', 'Top model', ...
'OutputFormat', 'CompiledBinaries');
On my laptop with Simscape licenses, I am able to compile the Simulink (CodeToCompile.slx) that contains the protected model, and the code works as expected. But people who does not have Simscape licenses are not able to compile the code. I tried to compile the Simulink model into C code, but that created mainy .c files, so I am not confident in how to import the compiled model into CodeToCompile.slx.
Am I missing an option into the Simulink.ModelReference.protect function ? Should I go with the generated C code, and add each .c and .h to the Custom Codes of CodeToCompile.slx ? Are there any other way to create a model from Model.slx that people who don't have Simscape licences can compile ?
Many thanks for your help !
0 comentarios
Respuestas (2)
Ayush
el 1 de Sept. de 2025
Editada: Stefanie Schwarz
el 20 de Oct. de 2025 a las 12:29
Hi, Valentin,
I understand you want to share a Simulink model containing Simscape blocks with colleagues who do not have a Simscape license.
You can refer this answer posted by MathWorks staff on similar issue:
Hope this helps.
Yifeng Tang
el 3 de Sept. de 2025
I don't think Model reference, protected or not, will allow the user to run without Simscape.
Do you have the licenses needed to create a standalone FMU? You can bring that into a Simulink for a non-Simscape user, and that won't require Simscape license.
0 comentarios
Ver también
Categorías
Más información sobre Configure and View Diagnostics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
