Standalone application can't execute the p-code

3 views (last 30 days)
Hello everyone,
I designed a GUI using MATLAb R2019b, in the GUI there is a button where pushing it executes the command:
run 'trial.m'
I want to share the GUI with other users so I must share the (trial.m) file too with them but I don't want them to be able to read the code inside the m file so I saved it as p-code file and in the GUI i changed the command to
run 'trial.p'
The GUI works fine with me as long as i am running it inside MATLAB, my problem starts after I save the GUI as "standalone desktop application"
Untitled.jpg
I attach the p-code file with the GUI so that when the user installs it, they will have the p-code file
Untitled2.jpg
When I run the standalone application, the GUI works except for the button that should run the (p file), the (p file) doesn't work. the error says that the GUI can't analyze the (p file)
So briefly, I made the p file to prevent the user from reading the code but instead I prevented the GUI from reading it too.
Is there a way to make the GUI access the p file?
Thank you

Accepted Answer

Image Analyst
Image Analyst on 2 Nov 2019
In your program, instead of having this:
run 'trial.m'
have simply this:
trial
When it's compiled, it will be able to find trial.m and build it into your standalone executable. The source code of trial.m will not be visible to your end users.

More Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!