Create Simscape protected or pre-compiled model for users who don't have Simscape licenses
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (2)
Ayush
il 1 Set 2025
Modificato: Stefanie Schwarz
il 20 Ott 2025
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
il 3 Set 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 Commenti
Vedere anche
Categorie
Scopri di più su Configure and View Diagnostics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
