MATLAB .exe distributable with pcode (*.p) file

Hi,
1) i have programmed a code with additional *.p file. the main GUI will be needing the *.p for most of the functions. at first i was thinking to build a GUI.exe that is fixed, if update programming is done, since most functions is in the pcode, only the *.p will be needed to be changed.
2) however i noticed that when the GUI is compiled into .exe, the *.p file is not needed??? is that mean distributable .exe is compiled including the *.p file in it?
3) when i compiled new *.p code and replace the old *.p file, the GUI.exe still load the old *.p code.
4) any recommendations so that 1) can be done, i think using .mat can right? other than that?
Thank you.

 Réponse acceptée

Kaustubha Govind
Kaustubha Govind le 10 Oct 2011

0 votes

MATLAB Compiler finds all *.m, *.p, MEX-files, etc. that your application calls, and packages them into a CTF Archive. It then generates a C/C++ wrapper that calls into your main .m file. So, your .p file is actually part of the CTF archive that is packaged with your executable. I don't think there is a reliable way to simply re-generate a new .p file and somehow plug it into the deployed application. As far as I know, you will need to re-compile the application if the .p changes.
Typically .mat files are added to the CTF archive when you add them under the "Additional Files" section in DEPLOYTOOL or use the -a option with the MCC command (I'm not sure if MATLAB Compiler automatically grabs it, but intuition says that it doesn't). You can probably use UIGETFILE to ask the user to specify a .mat file, so that a new one can be specified each time. Or, you could store the MAT-file at a common location on all deployment machines, and always look at that path.

6 commentaires

Walter Roberson
Walter Roberson le 10 Oct 2011
The encryption would differ between the two compilation sessions, so replacing the .p in the CTF would fail.
Nor Muzakkir
Nor Muzakkir le 11 Oct 2011
Kaustubha Govind, thank you for the explanation. will try to explore the .MAT method.
however if there is any other way to do as i explained in 1) please share.
Thanks!
Walter Roberson
Walter Roberson le 11 Oct 2011
I haven't figured out how the .mat would fit in to this? Are you talking about storing function handles in the .mat itself and pulling them out and executing them in the GUI ? That would rather seem to defeat the purpose of using .p files, since the clients could load() the .mat file and pull out the functions and examine them themselves.
(And I am not sure that storing functions like that would work.)
Nor Muzakkir
Nor Muzakkir le 11 Oct 2011
thanks Walter Roberson, it sure would defeat the purpose. is there any other solution that can still keep using the *.p file method? maybe there is some other way so that can make the GUI.exe able to load the *.p file.
Sean de Wolski
Sean de Wolski le 11 Oct 2011
So the GUI was programmed in GUIDE?
Nor Muzakkir
Nor Muzakkir le 12 Oct 2011
Yes.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by