This tool supports distribution of protected functions (P-code) that can be used to create applications via the MATLAB Compiler. Since the MCC command cannot analyze P-files directly to identify their dependencies, this tool supports a way for MATLAB authors to capture this dependency information into a single separate MATLAB program file that can be distributed with their P-files.
The tool analyzes MATLAB program files to identify their dependencies and writes these out as function pragmas into a separate MATLAB file. The latter pragma file when combined with P-coded versions of the original MATLAB program files can be used with the MATLAB Compiler to create standalone applications without access to the original MATLAB code.
Joel Hoff (2020). Protected Function (P-code) Dependency Analysis Tool (https://www.mathworks.com/matlabcentral/fileexchange/62367-protected-function-p-code-dependency-analysis-tool), MATLAB Central File Exchange. Retrieved .
Thanks for this very helpful tool!
There seems to be a problem with @-folder classes inside +-folder namespaces. E.g. for a class "test_class" inside the namespace "test_ns", the line that is added is:
It should be the following line instead, I believe:
Dear Ross, did you get the function to work? I'm still struggling, as the myPragmaFile.m only contains the .p-file and not, as I would expect, the used matlab functions.
Note to the other comments. To use it, you unzip the files to a folder, and then copy your main MATLAB script into that folder. Then follow the instructions in the createRequiredFunction.pdf. To make it work with the MATLAB Compiler app it looks like you can add the myPragmaFile.m to the additional files required for installation, and then use the "myapp.m" as the main file. Still working on getting to fully working, but this looks like its getting my in the right direction.
How Can i use this???
How can I analyze the dependency of an existing p file?