Standalone application can't execute the p-code

3 次查看(过去 30 天)
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

采纳的回答

Image Analyst
Image Analyst 2019-11-2
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by