While I'm publishing a M file, I also would like to publish some user defined functions. Can I have that done on the same output if the function is defined on another file?
Best Answer
I haven't found an easy way to do this, and I hope someone else can improve on my answer. Here's my approach, which requires some familiarity with HTML. First, publish each function separately. You need to set evalCode to false, which you can do using the menuFile -> Publish configuration for myfunction.m or these commands:
publishOptions.evalCode = false;
publish('myfunction.m',publishOptions)
Then you cut and paste the relevant HTML, which will be a block like this
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.
WHICH does not search through individual MATLAB files within a package directory. To find specific MATLAB files within a package, execute the following:
Best Answer