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

8 views (last 30 days)
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.

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 10 Oct 2011
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 Comments
Sean de Wolski
Sean de Wolski on 11 Oct 2011
So the GUI was programmed in GUIDE?

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Compiler 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!