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', ...
'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 !