MATLAB Answers

package matlab app without reveling source code

25 views (last 30 days)
nathan blanc
nathan blanc on 3 Oct 2021
Commented: nathan blanc on 8 Nov 2021 at 10:39
I have a MATLAB app that I would like to publish and share as a MATLAB app, but I don't want to reveal the source code. at least not all of it. I saw that most packaged MATLAB apps (Curve fitting, optimization etc) do not include the source code but when you package an app and install it all the files are available to the user. I know I can package the entire app as a stand alone desktop app but this is not what I am talking about at the moment. so my questions are:
  1. is there a way to package and install a MATLAB app (not a standalone desktop app) in a way that the contents are not exposed?
  2. is there a way to compile specific *.m files in a way that they can be called through MATLAB but cannot be read. I saw you can turn them into *.p files but this is not secure. or you can package them as executable files but then they cannot be called through MATLAB directly.
many thanks in advance
Nathan

Accepted Answer

Walter Roberson
Walter Roberson on 3 Oct 2021
If you are looking to create binary files that can be called from a normal MATLAB interactive session, then you can use MATLAB Coder to generate mex files; https://www.mathworks.com/help/coder/ug/how-to-generate-mex-functions-using-the-matlab-coder-project-interface.html You would then have to compile the mex source for each target operating system
  1 Comment
nathan blanc
nathan blanc on 3 Oct 2021
thank you for your answer Walter. what about my first question? is there a way to do this? do you know?
nathan

Sign in to comment.

More Answers (1)

Bruno Luong
Bruno Luong on 3 Oct 2021
Edited: Bruno Luong on 3 Oct 2021
"Is there a way to package and install a MATLAB app in a way that the contents are not exposed?"
In R2021b the compiler (MCC) it is possible to package with obfuscating file structures and file names (-s option).
  3 Comments
nathan blanc
nathan blanc on 8 Nov 2021 at 10:39
Thank you for you elaborate answer walter. The issue is now clearer to me

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by