Protect Code for Third Party Deployment

7 views (last 30 days)
Jacob Hensel
Jacob Hensel on 18 Nov 2019
Answered: Mark McBroom on 22 Apr 2022
I have a MATLAB script that will be used by a third party contractor to be further developed and placed onto an embedded system. More specifically, the third party will be using our code in a Simulink model that will be integrated onto the embedded system. I have tried to look into several options for distributing my code, however I am not sure the correct path to take. From my understanding, the Simulink model that will be developed will be coded into C/C++ by MATLAB Coder and flashed to the embedded system. Here are the options I have considered so far:
  1. Use MATLAB Coder or rewrite code in C using MATLAB API and supply a MEX function;
  2. Use MATLAB Compiler to create a linked library, standalone executable, CTF (does not seem to be possible for this specific use case);
  3. Deploy the source code as P-code (not recommended by Mathworks to protect IP from third parties).
Also, one of the main issues is that I am not sure of how to prepare my MATLAB script for use in Simulink flow. Is there anything additional that I need to do to my code other than provide a basic function that takes inputs and gives outputs?
Has anyone encountered this sort of issue and may have recommendations for code protection?

Answers (1)

Mark McBroom
Mark McBroom on 22 Apr 2022
Another option would be to put your MATLAB code into a SImulink model via a MATLAB Function block and then distribute the Simulink model as a protected model to the third party. https://www.mathworks.com/help/rtw/ug/create-a-protected-model-using-the-model-block-context-menu.html#:~:text=To%20create%20a%20protected%20model%20from%20a%20referenced,Generate%20Protected%20Model%20From%20Selected%20Model%20%20Block.

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!