MATLAB: Is there a way to publish P-coded files in MATLAB (R2013b)

MATLABpcodepublish

I have a top level p-coded file, which calls functions that also have been p-coded.
When someone runs my script and wishes to publish it, I only want the output of my hidden commands to be published (figures, numerical results, etc.). Is this possible?

Best Answer

The function PUBLISH works by reading the code file as text. Since the p-file is binary, publishing will not work. The code encryption causes publish to fail.
Attempting to publish a p-coded file will result in "spurious" output on the published script like the following:
v00.00v00.00
Publishing p-files is a bad idea, since it would cause users to interrogate the contents of the file. This would go against the main goal of p-files, which is to obfuscate the code.